MV YEP_skillcore skill that drains/restores TP

So I know this isn't quite right, but what I want to do is;

1) The custom cost would be a set percentage of the user's TP (65% in this case)

<Custom TP Cost>
user.tp * .65
</Custom TP Cost>

2) The After Eval would grant the target the 65% TP drained from the user.

<After Eval>
a.setTp(a.Tp + (user.Tp * .65))
</After Eval>
Plugin link, for ease of reference:
Try this (untested):

<Custom TP Cost> cost = user._giveTpSkillCost = Math.floor(user.tp * 0.65); </Custom TP Cost> <After Eval> target.gainTp(user._giveTpSkillCost); </After Eval>
65% of the user's TP after paying the cost will not generally be equal to 65% of the user's TP before paying the cost. So this adds a new property _giveTpSkillCost to the skill user whenever this skill's cost is re-evaluated: it's to store the cost that was paid.

If you wanted to use max TP instead of current TP (and max TP won't change while using the skill) then it becomes simpler, e.g.

<Custom TP Cost> cost = Math.floor(user.maxTp() * 0.65); </Custom TP Cost> <After Eval> target.gainTp(Math.floor(user.maxTp() * 0.65)); </After Eval>
Plugin link, for ease of reference:
Try this (untested):

<Custom TP Cost> cost = user._giveTpSkillCost = Math.floor(user.tp * 0.65); </Custom TP Cost> <After Eval> target.gainTp(user._giveTpSkillCost); </After Eval>

65% of the user's TP after paying the cost will not generally be equal to 65% of the user's TP before paying the cost. So this adds a new property _giveTpSkillCost to the skill user whenever this skill's cost is re-evaluated: it's to store the cost that was paid.

If you wanted to use max TP instead of current TP (and max TP won't change while using the skill) then it becomes simpler, e.g.

<Custom TP Cost> cost = Math.floor(user.maxTp() * 0.65); </Custom TP Cost> <After Eval> target.gainTp(Math.floor(user.maxTp() * 0.65)); </After Eval>

Okay, so the first part should do what I’m thinking (I should be able to Figure out what’s missing if not)

But could you explain the second portion where it checks the MaxTP? I’m confused how/why I could/would use something like that?
But could you explain the second portion where it checks the MaxTP? I’m confused how/why I could/would use something like that?
65% of the user's TP after paying the cost will not generally be equal to 65% of the user's TP before paying the cost. So...it's to store the cost that was paid.

If you wanted to use max TP instead of current TP (and max TP won't change while using the skill) then it becomes simpler
But could you explain the second portion where it checks the MaxTP? I’m confused how/why I could/would use something like that?
Using max tp makes the calculations simpler.

It would also changes the usability of the skill. Using max tp would require the user to have 65% of their max tp to use the ability.
Using max tp makes the calculations simpler.

It would also changes the usability of the skill. Using max tp would require the user to have 65% of their max tp to use the ability.
Oh okay that makes sense. Idk why I didn’t get that. Lol

Original thread: https://forums.rpgmakerweb.com/threads/yep_skillcore-skill-that-drains-restores-tp.158973/