Help needed - Change actor name after state wears off after a battle

I've been having a problem where I'm unable to change an actor's name only when a state wears off after a battle. The state removes itself at the end of a battle, and I want to change the actors name using a common event or some other way after. I have a skill that changes the actors name when used, and it learns a second skill which lets you return to normal, changing the name back, but if you use that skill state and just leave a battle you will still have the name while not being in that state.

Anyway I can change an actor's name after a state wears off after the end of a battle?
Bump
You could activate a switch when the actor gets the state, then make a common event with that switch as a trigger, which checks if the actor still has the state or doesn't. If not, the actor name is changed and the switched is turned off.
Yeah, I was thinking of doing something like that. But I don’t know how I would get it to activate at the end of a battle, besides doing it for every single battle individually in the Troops section, and every character that has a state.
You could use Shaz's state commands script. onremove: $actor[1].name = " "
No idea if that will work

Original thread: https://forums.rpgmakerweb.com/threads/help-needed-change-actor-name-after-state-wears-off-after-a-battle.130652/