How do i make a state activate automatically?

Im new to RPG Maker MV, but i would like to know how to have a class with a state attached to them that only triggers when they reach low enough health. Please help, as i'm inexperienced in this.
"How do I...?" questions belong in the Support forum for the engine you use.  So...


I've moved this thread to RPGMaker MV Support. Please be sure to post your threads in the correct forum next time. Thank you.



You have at least 2 options, one of which requires a plugin, and the second is easier with a plugin.  (I know Ace has scripts which do both of these, but I'm not familiar with the MV plugins to say whether or not there are MV versions.)


First - a passive state which triggers various changes once HP reaches the particular level you set, and changes back again if HP is increased with healing.  Can only be done with a plugin.


Two - Each troop event checks each turn if actor X's HP is in the critical range and the changes are then applied.  That is a lot of work, and is much easier if there is an equivalent to Yanfly's Base Troop Event script, because then you would event it only once and it would run automatically for all troops.
Yanfly passive states, if below 20% hp, state will activate


<Custom Passive Condition>


if (user.hp / user.mhp <= 0.2) {


condition = true;


} else {


condition = false;


}


</Custom Passive Condition>
I Installed Yanfly's Passive states plugin, and it works great! I was in need of this, because i wanted to make a game where it follows only one character at a certain point, and that the passive skill will give the player a second phase to work with before they falter in battle. Thanks you for your help!

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-a-state-activate-automatically.72698/