Help with Yanflys JobPoints

Hey Guys im Using Yanflys JobPoints Plugin to have an extra point system for character progression.
SO im trying sth like the sphere grid in ff10 so i basicly want to click an event that asks me to learn hp+10 and if i say yes
it checks the actors JP and if they are 150 or more decrease them by 150 and give the actor +10 max hp and then turn a switch on to prevent you from buying it more than once.
I tryed a few things like this:

if : $gameActors.actor(1).jp() > 149
show text hp + 10 learned
change max hp+10
skript: $gameActors.actor(1).jp() - 150 <-- this line not working
turn switch on: skill learned

else:show text: not enough points.


And it works as i want it to be as if i have 0 JP it tells me i have not enough to learn the skill
and after i battle and get 300 JP it says i learned the skill and gives the actor +5 max hp
and turns on the switch.
BUT it doesnt decrease the JP so the actor still hast 300 JP and i cant find a script call that
works in decreasing the value
loseJp actorId jp

^I believe this is the plugin command you want.

Alternatively...

Yanfly has a tips and tricks for this if you don't mind also using his skill learn system plugin.


edit: just to be clear it's a plugin command not a script call

Original thread: https://forums.rpgmakerweb.com/threads/help-with-yanflys-jobpoints.122645/