Script call for TP gain popup?

In my game, I'm using an ATB system and TP accumulates on a per-tick basis. By default, I want TP gain to follow its default behavior and not do any number popups for the 1-TP-per-tick that accumulates. However, if the player uses an item or whatever to gain a large chunk of TP all at once, I would like the number to pop up. Can this be done easily?

My assumption is that there's probably something natively in RPGmaker that I can call -- or, given that I use the core Yanfly plugins such as Battle Core & Action Sequences, there's something I can use as part of an action sequence / an After Eval thing?
I'd recommend the use of LGP_BetterDamagePopup by Azel, it shows tp gain and you can also add custom popups by using battler.customPopup()
Thank you -- using this plugin, it looks like I'm going for
user.customPopup(X, 1)
but if I want to call "how much TP did this battler just gain" what do I replace X with?
Thank you -- using this plugin, it looks like I'm going for
user.customPopup(X, 1)
but if I want to call "how much TP did this battler just gain" what do I replace X with?
That depends: where are you putting the script?
That depends: where are you putting the script?
I am using the script within a skill.

I have a second problem: the TP regeneration that I mentioned in my original post is an Auto Passive State, and it now shows a +1 by my character for every tick of combat -- is there something I put in the state to disable it? The code in that case is simply

<Custom Regenerate Effect>
user.gainTp(1)
</Custom Regenerate Effect>
I am using the script within a skill.

I have a second problem: the TP regeneration that I mentioned in my original post is an Auto Passive State, and it now shows a +1 by my character for every tick of combat -- is there something I put in the state to disable it? The code in that case is simply

<Custom Regenerate Effect>
user.gainTp(1)
</Custom Regenerate Effect>
You should be able to get the amount by checking the subject's _result.tpDamage then.
Thank you -- using this plugin, it looks like I'm going for
user.customPopup(X, 1)
but if I want to call "how much TP did this battler just gain" what do I replace X with?
Depends on your skill, for example in mine i did:
<After Eval>
var value = Math.ceil(((Math.randomInt(user.mtp) + (user.luk * 0.001))) * user.tcr);
if (value >= user.mtp / 2){
value = user.mtp / 2;
}
user.customPopup("+¡Flux: " + value + "!", 1);
user.gainTp(value);
</After Eval>

So you should add your tp gain as a variable, then display it JavaScript style.
Ah that approach will be easier for me than figuring out how to use Game_ActionResult (though I appreciate your help as well Trihan)

Still not sure how to hide popups for my passive state, though:
the TP regeneration that I mentioned in my original post is an Auto Passive State, and it now shows a +1 by my character for every tick of combat -- is there something I put in the state to disable it? The code in that case is simply

<Custom Regenerate Effect>
user.gainTp(1)
</Custom Regenerate Effect>
Ah that approach will be easier for me than figuring out how to use Game_ActionResult (though I appreciate your help as well Trihan)

Still not sure how to hide popups for my passive state, though:
If i remember correctly, you can use gainSilentTp instead of gainTp, it's the same just without doing a popup.

Original thread: https://forums.rpgmakerweb.com/threads/script-call-for-tp-gain-popup.158936/