Skill changing tp

Skill that decreases your own TP (but dosent cost TP) and increases opponents tp based on how much you lost.
I cant find anyway to increase opponents tp based on how much mine decreases. But i can make it decrease mine.
im using Skill Rewards YEP
<Hit Reward: - xTP>
To remove tp from myself but how do i make the enemy take TP based on x
how much should you lose?
like 80% or 100% of how much the player loses in TP. but im not sure yet so i want it to be flexible.

Player move TP loss is gonna increase depending on level, so i want that value to be changing aswell.
Maybe im not clear enough

I want to make a skill that removes a % of the user's current TP. And gives that same amount TP to the target.
First make skill cost 0 TP.

Than, in dam formula:

JavaScript:
var amount = a.tp; a.gainTp(-amount); b.gainTp(amount); 0

You can adjust amount as much as you want.
Let us know if you need any further explanation for the above.
how much should you lose?
like 80% or 100% of how much the player loses in TP
Player move TP loss is gonna increase depending on level
Maybe im not clear enough
i needed to know how much of the user's tp it'd remove (which is still kinda nebulous), and how much of that tp would be transferred to the target (which i had assumed to be 100%, but i dont know if that 80-100% was actually for the player as i had asked for, or for the target as it sounds like you meant)

Put this in the notebox for the skill. the notetag is from the skill core, but if youre using skill rewards then youre already using it
Code:
<After Eval>
var tpChange = Math.ceil(user.tp*(.8+user.level/500));
user.gainTp(-tpChange)
target.gainTp(tpChange)
</After Eval>
itll remove a percentage of tp from the user based on their level. the target will gain that amount of tp the user lost. the amount lost starts at 80% and increases by +.2% per level so that by the time the user hits lv 100 itll be 100%
First make skill cost 0 TP.

Than, in dam formula:

JavaScript:
var amount = a.tp; a.gainTp(-amount); b.gainTp(amount); 0

You can adjust amount as much as you want.
Let us know if you need any further explanation for the above.
ill use Robro33's notetag code as i understand it better.
i needed to know how much of the user's tp it'd remove (which is still kinda nebulous), and how much of that tp would be transferred to the target (which i had assumed to be 100%, but i dont know if that 80-100% was actually for the player as i had asked for, or for the target as it sounds like you meant)

Put this in the notebox for the skill. the notetag is from the skill core, but if youre using skill rewards then youre already using it
Code:
<After Eval>
var tpChange = Math.ceil(user.tp*(.8+user.level/500));
user.gainTp(-tpChange)
target.gainTp(tpChange)
</After Eval>
itll remove a percentage of tp from the user based on their level. the target will gain that amount of tp the user lost. the amount lost starts at 80% and increases by +.2% per level so that by the time the user hits lv 100 itll be 100%
it works but could i refrence instead of user.level make it based of a variable that determines a skill level. Like i made a Variable go up each time you upgrade a Skill and that number is used.
Can you use variables in the notetags is what im asking pretty much.
if you already have the variable, then the script call to get it is
Code:
$gameVariables.value(x)
with x being the id of the variable without the leading 0's
Technically @Robro33 idea is better since you shouldn't put that kind of code in the damage formula, but mine doesn't require a separate plugin.
At any rate, glad you got it working.
Works nicely

<After Eval>

var tpChange = Math.ceil(user.tp*(.2*$gameVariables.value(1)

));

user.gainTp(-tpChange)

target.gainTp(tpChange)

</After Eval>

this is the result, with var1 being the level for that certain move. Is there any plugin to make leveling moves easier without making a separate var for each one. I tried Skill Mastery YEP, but i don't want moves to level up upon uses. Like each move starts at level 1 then increases if you upgrade it with certain requirements. Or do i manually have to do something like that. Might be abit vague but i haven't planned out my whole idea of how the system will work.
i havent used skill mastery, but im making the assumption itd be easy to make it so that the skills dont gain exp on use. from there, youd be able use a script call in your events (or whatever you plan on using to level the skills) to level the skill for your actors

Original thread: https://forums.rpgmakerweb.com/threads/skill-changing-tp.177313/