Enemy Transform back not working

Hi! I'm gonna be as straight to the point as I can. I have a Ghost as an enemy. It has an ability that makes it invisible for a couple of turns and then, it goes back to be visible.

Guiding myself just a little from this thread, I sort of make it work but halfway

The ghost has an ability that's called Fluctuation. When it uses it, it activates a State called Evasion. I made a Common Event that checks whether the State Evasion is inflicted; when it is, I turn a switch ON (evasion_switch) and when this switch is activated, I use the command Enemy Transform and my Ghost "transforms" to another battler, also a ghost (but this one is a blank graphic with the same skills and info than the ghost).

It all really happens in the battle but there's no way I can make my Ghost be visible again.

1. I tried making a second Common Event that checks when Evasion State is inflicted, then the else part was to make the Ghost keep its original graphic. Didn't work.
2. I tried making a secondary Common Event to turn the switch OFF then, change the graphic back to the original.
3. I tried all of this inside my Battle Page (switch OFF, switch ON, conditional branches and elses, all the Spans). No results.
4. I tried the Enemy Transform and then Enemy Transform else again inside the same Common Event.
Picsart_22-06-06_12-44-11-315.png

I don't know how to make the Ghost be visible again. Any idea? I appreciate any workaround n.n

Pd: I have only this enemy in the troop and my game has only one actor.
perhaps shaz's on add/remove script.
perhaps shaz's on add/remove script.
Oh great! I'll take a look. Awesome. Thanks.
Oh hey ! I don't know if I should start another thread here because I applied Shaz's script and same results. I've been on this like for a week and I can't really make the Ghost be visible again. I thought it was the State but it really wears off as the Evasion message shows up saying "Ghost is visible again" but the no graphics enemy remains on my battle. I'm really losing my mind on this xd
What are you doing with Shaz's script?
on_remove ??
is this in a battle scene?
Hi! I hadn't been able to connect. But here I'll post some screenies of what I got it.
Picsart_22-06-22_10-17-32-095.jpg

This is the common event.

Picsart_22-06-22_10-22-09-591.jpg

And this is the battle event. The first page is just a comment from the enemy atthe end of the battle.

I made it work but the kid disappears and appears like a snap. I want to make it disappear by a whole turn.

Thanks to anyone who could help.

Original thread: https://forums.rpgmakerweb.com/threads/enemy-transform-back-not-working.148379/