Permanently delete event

I made a spell that transforms the player into a random monster. When the player becomes an imp for example, I want all imps to no longer be hostile.

If I use self switches the defeated imp (which should be gone) reappears once the "transform" switch becomes active and if try to erase the event first it works fine then once I leave the map and re-enter it respawns.

This is how it looks right now:



Nevermind, I got it working.
Nevermind, I got it working.
This thread, is it solved? have you found your answer?

Original thread: https://forums.rpgmakerweb.com/threads/permanently-delete-event.90169/