Creating a skill based on Current TP

Hello. I'm trying to create a skill that will deal additional damage based on the current amount of TP and then remove all TP. However, it seems that when I try to remove current TP, it will cause the skill to say NULL when attacking an enemy.

I used this formula in the Damage formula box:

(a.atk*(a.tp/20).to_i)+a.atk*5-b.def*2;a.tp -= a.tp

 

I'm sure some characters are not necessary, but I'm still a novice.  🙂

 

I removed the ending part [a.tp -= a.tp] and it seems to work, but now it doesn't remove any TP (initial cost is 0 so that it can be used at different TP values).

 

Can anyone explain to me a way that I can accomplish this? Or possibly my formula is not correct.
try this:

c = (a.atk*(a.tp/20).to_i)+a.atk*5-b.def*2; a.tp = 0; c

The actual damage part of the formula must be at the end.
try this:

c = (a.atk*(a.tp/20).to_i)+a.atk*5-b.def*2; a.tp = 0; c

The actual damage part of the formula must be at the end.
Thanks! This seems to be working as intended now.  😉

EDIT: Thread may close.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-skill-based-on-current-tp.16044/