Change actor sprite based on TP

Hello. Is it possible to change the set of sprites of an actor, based on the TP of said character?
For example, actor has max TP of 100, so he have sprites 1. At the same time he has 0 tp, so he has the base sprite 1 with details 1.
Later in the game, actor will have 50/100 tp, so he will have details 2 with sprite 1..
much later character will have max tp of 150, so they will have sprites 2... and if they have 50/150 they will have details 2 whith sprites 2.

And so on... As the actor gains more max tp, the sprites will change to show that, and as they gain TP, it will give them some details.

I can see in the common event a way to change said character sprite, but i dont know how to link this event with the actor
I would give the actor a passive state from Yanfly's Auto Passive States.

You can give that state notetags from Yanfly's Buffs & States Core to check TP at various times.

You'd want to check after the actor takes damage, so Custom Respond Effect, then after the actor uses a skill that could give TP, so Custom Regenerate or Custom Turn End.

Each notetag can have the same code, just a series of if statements that checks the current TP and sees if the sprite should be changed.

If you're not good with JavaScript, you could just put the script call for a common event and do it with event commands (although as far as I know you'd still need another script call in there to get the actor's TP). Going that route, you'd want a separate passive state and common event for each actor this can apply to.

Original thread: https://forums.rpgmakerweb.com/threads/change-actor-sprite-based-on-tp.161079/