Blocking bar, increasing it, applying debuff when full.

Im making a blocking bar, replaced TP with it(YEP_EnhancedTP). Its supposed to increase when guarding moves and each move deals different guard bar damage, when the bar is full it should auto apply a state (Guardbroken) automatically.
I've been trying to check other threads and stuff but i just cant seem to make it work.

Guarding is a State so if you're guarding the damage is set to 0 and the guard bar goes up. That's all the details.

edit:

ive hit a dead end, this one should work but it doesn't i really don't know anymore

<Custom React Effect>
if (target.isStateAffected(2)) { // the state you get from guarding
target.gainTp(10); // Adds 10 TP to the target if state guard
}
</Custom React Effect>

is should work but i don't know what's wrong. Using YEP_BuffsStatesCore.
Thats all the details.
did you use a plugin to achieve this? cause most of what you described isnt how the engine handles any of it by default.
yeah i used YEP_EnhancedTP, i made the gain from everything 0.
i can see it being done with yanfly's buffs and states core plugin.

give the guard state these notetags
Code:
<Custom React Effect>
if (this.isDamage()){
  value = 0;
  target.gainTp(this.item().tpGain)
}
</Custom React Effect>

<Custom Respond Effect>
if (target.tp == 100){
  target.removeState(stateId)
  target.addState(x)
  target.setTp(0)
}
</Custom Respond Effect>
just replace the x in the respond effect with the id for guard break. the tp gain will be set to whatever the skill's tp gain in the database is.
im not sure if you wanted the hit to that breaks the guard be subject to guard's damage reduction or if it should be exempt, but with this the guard is removed and the state is applied after the hit

---
good thing i refreshed the page
<Custom React Effect>
if (target.isStateAffected(2)) { // the state you get from guarding
target.gainTp(10); // Adds 10 TP to the target if state guard
}
</Custom React Effect>
what is this notetag on? if its on your guard state, then theres no need to check if the target has state #2 on them. if its not on your guard state, then its not where it should be unless this is a separate passive state you have to handle the effect
EDIT: dont mind that i figured it out, i understand what you mean, thanks. One last question, can i make enemies have TP gain even if they're not using guard. So they also get affected by the guard damaging moves but in a different way?
how do i set up the tp gain on skills?
1745866920468.png
EDIT: dont mind that i figured it out, i understand what you mean, thanks. One last question, can i make enemies have TP gain even if they're not using guard. So they also get affected by the guard damaging moves but in a different way?
i figured this out too maybe, just make a state that every enemy has. And that increases their TP, but do enemies even have TP?
And that increases their TP, but do enemies even have TP?
yes. you cant see it without a plugin, but enemies have TP in MV that functions identically to how it does for actors
Edit: again.. stupid question i figured it out. mb

Thanks for all the help with this, its nice having people help you.

Original thread: https://forums.rpgmakerweb.com/threads/blocking-bar-increasing-it-applying-debuff-when-full.177295/