MV Item that removes all skills from the user and refunds job points?

Hi, first time poster!
I'm currently trying to make an Etrian Odyssey-like game in RPG Maker MV. There was a particular mechanic I wanted to try replicating. The "Rest" mechanic allows the player to make a character from your party forget all their skills and be refunded skill points back at the cost of 10 levels. This essentially allows you to re-spec/re-customize your party members in case you wanted to change up your strategy/character synergy. I want to make something like this for my game too.

Plugins I'm using for my skills system:
  1. YEP Class Change
  2. YEP Sub Classes
  3. YEP Skill Core
  4. YEP Skill Learn System
  5. YEP Job Points
Instead of an option in a menu, I wanted to use an item you buy and a common event to do this. I was looking up ways to do it but could find anything specifically pertaining to this. Or maybe I was not looking in the right places.

Anyway, one of the issues I was getting was trying to get the id of the character the item was used on. That way I can maybe store it in a variable in the common event and refer to that when removing all the characters skills and refund jp. (btw jp is rewarded at a set amount upon lvl up, so for refund jp it would be actor lvl * 10 = refund amount).

Any help is appreciated!

EDIT: I just realized I posted to the wrong forum. This is supposed to be in JavaScript/Plugin Support I think. Don't know how to move this.
I think you get the item target in menu with $gameParty._targetActorId
There's plugin command to set the job points. If you need the cost from only some skills, I think you get the skill's jobpoint cost with "skill".learnCostJp
If you don't get any skills by default (like you need to buy them all), I think you can just use "actor".initSkills() If you need to get rid of default skills too, you can loop through "actor".skills() to forget all.
EDIT: I just realized I posted to the wrong forum. This is supposed to be in JavaScript/Plugin Support I think. Don't know how to move this.
got you covered

I think you get the item target in menu with $gameParty._targetActorId
You should be able to, but theres a getter function for the actor that also has a fallback to return the leader.
Code:
$gameParty.menuActor()
Hmmm, I thought that menuActor() wouldn't work in this case. Just tested it and it seems to return the actor that was previously selected as active in some other scene.
Hmmm, I thought that menuActor() wouldn't work in this case
I had read "_targetActor", had it in mind, and then said menuActor in the end anyways 🤣
$gameParty.targetActor() is what I meant
Hello! Thank you for the responses! I tried implementing the feature last night but no luck. The item does nothing. I think I'm doing it the wrong way.

Also, I failed to mention I'm using YEP Plugin Command Switch & Variable Access plugin.

1752349380937.png
First line you want to get the actor id $gameParty.targetActor().actorId()

Third line isn't doing anything. If you want to remove all skills, it'd be like:
$gameActors.actor($gameParty.targetActor().actorId()).skills().forEach(skill => {
$gameActors.actor($gameParty.targetActor().actorId()).forgetSkill(skill.id);
});
(Maybe you could also remove all skills by just changing some skills array/object to empty, but I don't have the motivation to check.)

Original thread: https://forums.rpgmakerweb.com/threads/item-that-removes-all-skills-from-the-user-and-refunds-job-points.178851/