How to use VisuStella Custom Parameters

So, VisuStella has the ability to add custom parameters. I was curious how to actually set these up and use them on both characters and monsters.

The exact specifics of what I'd like to do is make custom parameters "Psionic Attack" and "Psionic Defense". I've added "Psiat" and "Psidf" as parameters already, and even incorporated them into the damage formulas. But, I don't know how to set their values per class/character/monster. Like, I'd like my main character to have a 1 in both stats, but my psion character to gain points as they level.

I also have no idea how to give these stats to monsters. I saw the "<param: x>" notetag, but it speciflcally states "This notetag does NOT work with X Parameters, S Parameters, or any custom parameters. This notetag ONLY works with the base parameters."
You could use parallel events. Or a plugin that calls common events upon level. Or I Googled "visustella custom parameters" and the first hit was this plugin:
Awesome, it works. It is missing support for buffs/debuffs and states, but that's okay for now. It works well enough. Maybe I can have my coder friend help add those.
It is missing support for buffs/debuffs and states
As far as buffs, you have to realize that these "custom parameters" aren't actually parameters. They're just variables stuffed into the actors, and VisuStella provides support for their menu screens to display them in a pretty way.

So a buff, as RPG Maker uses it, can't work with them the way it does with the default parameters because they're not calculated/referred to in the same way at all.

The above plugin does start a bit of the process, with splitting them into a base and plus the same way the default parameters are, so it wouldn't be a terrible lot of work to add buff calculation - but then you'd have to add a made up buff using JavaScript evals in your skill and make sure any other part of the game engine that refers to buffs knows how to use it.

As far as states, that looks like it should be a trivial modification. Take the param plus function:
Code:
Game_Actor.prototype.customParamPlus = function(paramId) {
  let value = Game_Battler.prototype.customParamPlus.call(this, paramId);
  for (const item of this.equips()) {
      if (item) {
          toadd = parseInt(item.meta["cp[" + paramId + "]"])
          value += (isNaN(toadd) ? 0 : toadd);
      }
  }
  return value;
};

and add a second loop that looks at the states.
Code:
Game_Actor.prototype.customParamPlus = function(paramId) {
  let value = Game_Battler.prototype.customParamPlus.call(this, paramId);
  for (const item of this.equips()) {
      if (item) {
          toadd = parseInt(item.meta["cp[" + paramId + "]"])
          value += (isNaN(toadd) ? 0 : toadd);
      }
  }
  for (const item of this.states()) {
      if (item) {
          toadd = parseInt(item.meta["cp[" + paramId + "]"])
          value += (isNaN(toadd) ? 0 : toadd);
      }
  }
  return value;
};

Now it should function correctly for you to add the exact same notetag to states.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-use-visustella-custom-parameters.160140/