When a character joins a unit that is under the effect of a spell that affects the entire unit, the character only benefits or suffers from the effects of the spell whilst they remain in the unit. Similarly, if a character is the subject of a spell that is capable of affecting a unit, the effect will also apply to any unit they join, for as long as they remain part of it, and the spell lasts.