How to add state if class is present, and 1 other state

Hewwo, i want to create a passive skill using Yanfly's passive state core, where if a certain class is in the party or a enemy has a certain class it applies a state to the actor, similar to the Third Eye states from Grand Summoners:

1693072509210.png


Extra Inquiries:

How to add stacking boosts to stats.

How to add a damage increase to a certain class
I can't really think of an elegant solution to this problem, but I CAN give you a stupid and hokey one I thought up if you want?

Use the passive state core to mark each actor class and enemy that should trigger this effect with an identifier state. Then use Yanfly's Base Troop Events plugin to create a troop event page that runs on turn 0 in every battle. In there, put a bunch of conditional branches that check all actors and enemies for that identifier state. If present, give the appropriate state to the target you want.
I think the scripts are:

Party battlers:
$gameParty.battleMembers().some(function(member){return member.isClass($dataClasses[X])})

Enemies:
$gameTroop.members().some(function(member){return member.enemyId() === X})

If you want to add the state outside of battle, use 'members' instead of 'battleMembers'. Also, that troop script is for enemy IDs. If you have some plugin that adds enemy classes, you'll have to switch that to reference them. Also, there's a script that can check only alive members.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-state-if-class-is-present-and-1-other-state.160651/