Buff to party - Character dependent

I am trying to find a way to make it so that if a character is in the party (the 4 players that go into battle), then they will get buffed with different buffs depending on who's all in the party make up. Is there a way to do this? I tried creating a common event but it didn't work. (It buffed up the party despite whether he was in the 4 or switched out)

Original thread: https://forums.rpgmakerweb.com/threads/buff-to-party-character-dependent.53763/