Enemy transformation during battle?

I'm wondering if there's a script or some kind of common event trick that I can use to make an enemy's sprite change partway through battle without resetting its HP.


For example, when fighting a masked boss the mask cracks when he's at 50% HP, and falls off when he's defeated.  Is there any way that I can do this?
use the troop events, no need for scripts.


first use a control variable to store the HP of the boss into a variable, thenuse the transform enemy command to change the boss to a different enemy (the only difference might be the picture, or you could give it different data) and then use the change HP command to change the HP again to the stored number (requires a bit of mathematics to calculate the change)
You don't need to save the enemies HP either. Transforming an enemy will preserve its HP, MP, states etc. if possible (HP is only reduced if it exceeds the new enemies MHP for example).
You may want to take a look at this tutorial. It might provide better insights into how a transformation could work.

Original thread: https://forums.rpgmakerweb.com/threads/enemy-transformation-during-battle.60755/