I'm doing this as a universal passive state using Yanflys Buffs and States core and Passive States, I've tried several variations but I'm messing up somewhere.
Triggering the gaining of TP on critical hit.
Javascript/Plugin Supportthis is mine that works perfect (this is in the State):
<Custom Establish Effect>
// Check if the attack is a physical attack that dealt HP damage from a critical hit.
if (this.isPhysical() && target.result().hpDamage > 0 && target.result().critical) {
user.gainTp(5);
}
</Custom Establish Effect>
It does exactly as your title asks, gaining additional TP when dealing a critical strike. by default in my game, attacking gives you 5 TP, so this passive state effectively means you get double TP when you deal a critical.
<Custom Establish Effect>
// Check if the attack is a physical attack that dealt HP damage from a critical hit.
if (this.isPhysical() && target.result().hpDamage > 0 && target.result().critical) {
user.gainTp(5);
}
</Custom Establish Effect>
It does exactly as your title asks, gaining additional TP when dealing a critical strike. by default in my game, attacking gives you 5 TP, so this passive state effectively means you get double TP when you deal a critical.
Original thread: https://forums.rpgmakerweb.com/threads/triggering-the-gaining-of-tp-on-critical-hit.118660/