Reduce TP upon dying.

Is there a way to create reduce an actor's TP when his hp is reduced to zero.
I'm thinking about Yanfly Buffs & States core script. Can someone help? Thanks in advance.
I was wrong.
As in when the actor dies it loses all its current TP? I can help you with that one. If you are using Yanfy's Buff and State core paste this in your Death state note box :
<Custom Apply Effect>
{
user.gainTp(-X);
}
</Custom Apply Effect>
Where X is the maximum TP one of your actors can have, like -1000 for example, just to be sure 😉. When they die and the state is applied, they should lose all the TP.

Hope it helps you!
It works, thanks

Original thread: https://forums.rpgmakerweb.com/threads/reduce-tp-upon-dying.94143/