Change actor graphic on death

I have a character with a transform ability that, in addition to adding a state and swapping out some abilities, also changes the actor's graphic - I'm using Jet's sideview battle script. There is a revert common event that gets called after each battle ends, as well as once the character drops below a certain amount of TP in battle.

I spent a long time trying to figure out how to call the revert common event whenever that specific actor dies, however, because I also want the transformation and subsequent abilities and state removed upon death. I tried adding the revert common event to any revive items or skills, but of course she then reverts whenever anyone is revived, not just her.

My brute force fix was initially to add a troop tab to every single troop that checked each turn if the actor's HP was 0% or below, and if so, to call the revert common event. However, I recently changed to a CTB system, so "turns" happen randomly between about 1-3 actions. This means that the revert common event might not get called before the actor is resurrected if the resurrection is performed quickly enough.

I don't know of a way to add the change graphic to a state, but even so, I can't add the abilities to the state. I tried doing "add skill" and "seal skill" to the transformation state, but then it greys out the particular abilities instead of completely removing them (which is no good).

I could potentially setup my troop tabs to check "moment" instead of "turn" for the actor's HP being 0% or below, but I can't figure out how to do that without the game then freezing up (because every single moment, once it's triggered, the actor's HP will be 0%, indefinitely). I'd like a more elegant solution than adding a new page to every single troop tab, but in the long run, it's really not that much of a pain in the ass.

Does anyone have any ideas?

EDIT: And of course, despite weeks of trying to figure out how to do it, once I've posted the question, an idea comes to mind, although I'd still be up for a better solution. When the transform common event is called, I have a transform switch being turned on, so I can make each troop tab set to "moment" and "actor's HP is 0% or below && transform switch is on," because when the revert common event is called, the transform switch is turned off, and thus the "moment" page will stop processing until the next time the actor transforms.

Original thread: https://forums.rpgmakerweb.com/threads/change-actor-graphic-on-death.19394/