State that makes an actor invisible.

Trying to make a character invisible with a state and than visible when a state wares off.
to do this I want to force an action when a state wares off.
This is using Yanflys state and buff plugins.
<Custom Leave Effect>
var skill = 93;
var target = -2;
BattleManager.queueForceAction(user, skill, target);
</Custom Leave Effect>

For some reason nothing happens when this is executed.
Im not getting any errors in the editor either.
I'm assuming that User is the actor that this state is happening to.
I've seen other users use scripts like this but I cant get this to work.
Am i missing a plugin or something?

Thanks.
1611107802230.png
I accomplished this using the <state animation: x> tag in Yanfly's YEP_X_VisualStateFX and creating an animation that has a "hide target" flash for the entire duration. I intentionally left a "flicker" in mine because it's not a magical invisibility spell, it's a high-tech implanted cloaking device (think Ghost In The Shell) but in theory if the flash is the duration of the whole animation there wouldn't be a flicker (not sure, haven't tried).
Alternate plugin by Mokusei Penguin: MPP_VanishState (Translucent Effect)
https://forums.rpgmakerweb.com/index.php?threads/mpp_vanishstate-translucent-effect.80502/

You can create a state that makes a battler look invisible during battle. Not sure if it works with Yanfly plugins.

MghjFr6.png
Alternate plugin by Mokusei Penguin: MPP_VanishState (Translucent Effect)
https://forums.rpgmakerweb.com/index.php?threads/mpp_vanishstate-translucent-effect.80502/

You can create a state that makes a battler look invisible during battle. Not sure if it works with Yanfly plugins.

MghjFr6.png
IIRC it worked perfectly well alongside many of Yanfly’s plugins in a previous project of mine.
you can also play with the translucency and use it to create colour tints to an extent (but, again, IIRC it colourises the whole sprite so wasn’t a perfect solution for that).
Thanks so much.
Looked all night yesterday trying to find something like this.
Thanks thanks.

Original thread: https://forums.rpgmakerweb.com/threads/state-that-makes-an-actor-invisible.132425/