Help with adding states based on condition

Hi everyone,

For my game I'm trying to add certain states through skills, but only if the opponent already has a state.
Example:

Opponent burning zombie: Passive state (Yanfly's passive states) Burning
If the character uses a Fire spell this would on normal enemies not do anything, but if the enemy already has Burning, I want the state "Panic" to activate.

Ideally it would like to also involve some randomness in this. To continue previous example
Fire spell: 75% of Panic, 10% Rage, 15% nothing happens, if Opponent is Burning.

I hope this is possible,

Thanks in advance.
You could do that by utilizing the damage formula..
Thank you, but that doesn't really solve my problem. I could probably through some effort figure out the part where the required state induces one state. But the randomness would be more difficult.
I assume the state would look something like this:

isStateAffected(11) ? addState(12)

That only allows me to always set one state, while I would like it to only set one state 75%, another 10% and do nothing 15%

Original thread: https://forums.rpgmakerweb.com/threads/help-with-adding-states-based-on-condition.106391/