MV Yanfly Job Points as Global Resource

I'm here wondering if Yanfly's Job Points plugin can be made into a global resource that all actors share.

In its current build each class of each actor has their own pool of Job Points that are earned in battle. The issue I have is that after the actors have learned all their skills in each class there's no longer a proper use for Job Points unless I set it up for growing stats or giving items. I would prefer Job Points to be a global resource that must be shared between everyone and can even be used with Yanfly's More Currencies plugin.

In summary: Job Points are earned in battle by taking actions, leveling up and defeating enemies like the original design but is sent to a global resource similar to gold. Characters can use this resource to learn skills or it can be used in certain shops as another form of payment using More Currencies.

Even increasing a variable based on those conditions would work as I'd be able to modify it more easily. Any help would be greatly appreciated.
I don't know if this is what you're looking for, but maybe you can set an event or an item that allows you to transfer JP from one actor to another. Yanfly Job Points already has plugin commands that allow gain or lose JP from specific actor.

Another workaround that I can think of is to set a common event that converts JP after winning into item.
I took a look at the plugin commands but only found gain, lose and set. There's no way, as far as I could find, to identify how much an actor has. If there was then maybe I could convert it into a variable and remove it from the actors after each battle. Yanfly also has a Utility Common Events plugin that I could trigger after battle to make the conversion happen, but I need a way to identify and access each actor's collected Job Points. I would assume the plugin adds parameters to keep up with it but I don't know how to find that.
I took a look at the plugin commands but only found gain, lose and set. There's no way, as far as I could find, to identify how much an actor has. If there was then maybe I could convert it into a variable and remove it from the actors after each battle. Yanfly also has a Utility Common Events plugin that I could trigger after battle to make the conversion happen, but I need a way to identify and access each actor's collected Job Points. I would assume the plugin adds parameters to keep up with it but I don't know how to find that.
Hi @Zanto1050

It's entirely possible because you can retrieve the JP value of an actor (for a specific class or current class).

If you have the Utility common event plugin, it will be quite simple:

1) You create a common event (which you will call each time you win or flee from a battle)

You can retrieve the JP value of an actor for a class with :
Code:
$gameActors.actor(1).jp(1); (for actor 1 and its class 1)

2) In the event, use the script button (3rd page) and paste the following:
Code:
let current = $gameVariables.value(X);
let totalJP = 0;

$gameParty.members().forEach(actor => {
    totalJP += actor.jp(actor.currentClass().id);
});

$gameVariables.setValue(X, $gameVariables.value(X) + totalJP);
(Don't forget. forget to replace X in the code by your variable that will serve as money)

3)
Use plugin command and paste :

setJp Y 0
setJp Y 1
loseJp Y 1
Replace Y with the ID of the actor used.
And create as many plugin commands as you use actors.

Result:

At the end of each battle, variable X will accumulate all the JP earned by the characters during that battle, then reset each character's JP to zero.
This will “transfer” the JP to the variable.

EDIT :
It seems that setJp X with 0 is not accepted...
We will do setJp X 1 followed by loseJp X 1.
(Like my Screenshot)

1754864650905.png

(Text is just for my test)
EDIT :
It seems that setJp X with 0 is not accepted...
We will do setJp X 1 followed by loseJp X 1.
Instead of using setJP, you can use loseJP actorID (JPvalue of actor ID).
Something like this for actor 1:
Code:
loseJp 1 $gameActors.actor(1).jp()
Thanks @alasth . I'm not very talented with js but I did understand some of what you wrote. The email didn't show your edit so to answer your question, class changing is a major part of the game and is part of the story. There will only be four actors and they each have 6 unique classes. Basically the same classes but I made copies for each character so they can have unique skills using Yanfly's Skill Learn system. It's similar to Final Fantasy 13, characters use the same classes but have different skills per character.

Since the player will only be allowed to class change in the menu and not in battle, using current class in the common event should work as intended. I'll give it a try when I get the time.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-job-points-as-global-resource.179497/