DiamondandPlatinum3, You are a
wizard indeed!
I've play-tested your script various times with various settings, and this works like a charm. I'm especially grateful for your addition of which animation to play upon transformation.
Allow me to show a little insight in the mechanics in-game:
One of the characters uses a special kind of magic, which
just by being used can destroy the protective 'hide' of demons. Basically, almost every enemy has two forms: a black hide version, and (when it transforms) the true form, with weakened defense.
Your script will allow me to make the battle system a tad bit more interesting. Boss foes will take longer to 'lose' their defense, and some demons may be able to grow it back. This is a core element of my game, both story wise and for the battles.
Thank you so much for creating this. With your permission I'll name you in the credits as a script writer.