MV State that causes the user to become invisible?

Hello. In my game, they're are multiple states that cause the battler inflicted to disappear from the battle. One of these states is called "X-Zone," which acts as a "death state." meaning that if all allied battlers are inflicted with this state, the game is over. X-Zone is different from death (or KO) because a character cannot be brought back from X-Zone with a revival item or spell, but unlike death X-Zone wears off at the end of battle. The other state is "vanish," where the battler inflicted with this state is unable to be targeted or take damage until the state wears off, but the battler is not able to act while the state is active. In the instance of both states, the battler in question appears completely invisible, meaning that it cannot be seen by the player despite it technically being there. This applies for both actors and enemies, not one of the other, leading for this to become even more complicated.
I know you can make enemies and allies alike become invisible with Yanfly's action sequences, (which I am using) but I'm not exactly sure how to trigger action sequences with states. Also, I do know that Victor did make a plugin for this. However, since all victor plugins require the base victor plugin which is incompatible with every plugin from nearly every dev, (most notable Yanfly, which about 80% of RMMV devs use, 98% before PluginGate) I sadly cannot use this plugin at all. Does anyone have an alternative plugin I could use, or a way to trigger Yanfly's action sequences using states? Thanks.
Bump
Just so I understand, you want action sequences in your skills to check and do something if a state is applied on a battler? Or you want to modify what happens when the states are applied?
If it's the latter you could try using Yanfly's BuffStatesCore. If I recall correctly, it gives you a lot of control over a states effects though you might have to use Lunatic Mode notetags for complex effects, and that requires some Javascript knowledge.
@DawnStar I want to activate a action sequence when the state is applied. That is correct. The action sequence is what I need to turn the battler invisible. Now, I was already able to apply what I wanted from the "disappear" and "appear" skills a certain boss uses which switches if they can be attacked or not because it was linked to a skill and the skill had a 100% chance to apply the state. However, the other state, X-Zone, is linked the multiple other skills and those skills have only a chance of inflicting the state, so I would need to have the action sequences only activate when that state was applied. Do you know how to do that? I don't know any javascript, so I can't do lunatic mode myself. Can you help me with that? Thanks.
@KrimsonKatt, right now I don't have BuffStateCore installed on my project but I think it can be done with just action sequences. In every skill that can apply the effect, after the action effect part you set an if that checks if the state was applied. Something like this (it's not the actual code just to give you an idea):
JavaScript:
<target action>
action effect
if target.isStateAffected(#) // # is the number ID of the X-Zone state
    // become invisible etc.
end
</target action>
Will try to replicate the skill in my project and see if this works out.
Turns out the code I posted above works though it might be better to put that in the follow action instead of in target action.
JavaScript:
<follow action>
wait: 30
if target.isStateAffected(11)
    // put your action sequence code here
end
</follow action>
Thanks for the help! Sorry this was late. I was banned for 2 weeks for posting religeous stuff publicly. Sorry about that.

Original thread: https://forums.rpgmakerweb.com/threads/state-that-causes-the-user-to-become-invisible.131259/