conditional immunity to states

I'd like a way to set conditions for states, without having to put it in every skill damage formula.

For example, there's a state that I'd want to only be inflicted if the target is below 50% hp. So I'd want it to be impossible for a player or enemy to be affected by that state if they're above 50% hp.
Search for tsukihimes' placeholder states.
That script will allow you to define states that change into other states on conditions, and then it is only a matter of correct definitions.

Original thread: https://forums.rpgmakerweb.com/threads/conditional-immunity-to-states.89076/