How to get parameter values without equipment/Param Rate?

I have consumables that will permanently increase stats, and want to make it so that, if an actor targeted with one of these items already has the given stat at the maximum value allowed, the item will say it will have no effect. At the moment, I am doing this through a Common Event, with the item inflicting an invisible dummy state to track who the item was used on, and the Common Event intended to refund the item if it would fail to raise a stat.

Where I'm stuck is how to check a character's stats ignoring increases from their equipment and Param Rates. My original plan was to tally up a character's parameter bonuses from their equipped items, and then subtract it to get their "real" stat.

I don't remember everything I've tried (it was a lot thanks tot he Script Call thread), but the final thing I attempted before giving up and making this thread was a Conditional Branch using a script, being:
Code:
$gameActors.actor(1).atk - ($gameActors.actor(1).equips()[0] === null ? 0 : $gameActors.actor(1).equips()[0].params[2];) < 999
The intention with the above was to take Actor 1's Attack stat, then check if they had a weapon; if no, nothing would be subtracted from their Attack (since there would be no need), but if they did have a weapon equipped, that weapon's Attack parameter would be subtracted to get the Actor's base value. Regardless, if this resulted in less than the stat limit of 999, then the item would be consumed and increase the Attack stat accordingly. Otherwise, a message would be given saying it won't have any effect, and the item would be refunded. However, the above always returns the "fail" message. I also learned that it would do so if I tried to check equipment, and a given equip slot was unoccupied.

I'm sure there's a much simpler way to get what I want - getting an Actor's given stat without equipment or Param Rates, but factoring in growth from Levels and consumables - but I am not smart and I am out of ideas.

I am using Yanfly's Base Param Control and Equip Core. The latter is important to note, since I intend to have characters able to equip two Accessories.
Hi there!
I believe you can use the script .paramBase(ID)

If I record well, this will give you what you want. I'm not on my desktop now to confirm this. perhaps someone could do that.
This is only a piece of the Puzzle I can provide to pull some data from but this is A way I came up with to help substract from a value that is constantly changing throughout the game.

JavaScript:
$dataClasses[1].params[2][$gameVariables._data[31]]

with this Code, you are going to need a Variable that keeps track of a Character's level too but that's simple to setup within RMMZ.

the Variable will tell the Code what Level the Character is and then the Code will give you the amount of ATK or any other Stat you ask for.

Keep in mind that this will pull the data from the CLASS and NOT from the Weapon!
you can try using the reduce function
Code:
$gameActors.actor(1).equips().reduce((atk, equip) => equip ? atk-equip.params[2] : atk, $gameActors.actor(1).atk)
thatll look at their current atk stat, go through all their gear and subtract any atk it finds, and then return the value at the end
you can try using the reduce function
Code:
$gameActors.actor(1).equips().reduce((atk, equip) => equip ? atk-equip.params[2] : atk, $gameActors.actor(1).atk)
thatll look at their current atk stat, go through all their gear and subtract any atk it finds, and then return the value at the end
That won't work because it wouldn't take into account any paramPlus changes.
the default engine's param getters take the actor's paramPlus into account already, no?
Does Yanfly's base param plugin change that? I havent used it to know if it does
Hi there!
I believe you can use the script .paramBase(ID)

If I record well, this will give you what you want. I'm not on my desktop now to confirm this. perhaps someone could do that.
Unfortunately, this isn't quite what I want: an actor's given parameter, taking into account their Level/normal growth, plus any growth from a consumable, but NOT increases from anything they have equipped, nor the Parameter Rate function.

the default engine's param getters take the actor's paramPlus into account already, no?
Does Yanfly's base param plugin change that? I havent used it to know if it does
I'm not knowledgeable of scripting, so it's possible I missed something in the plugin's actual coding, but as far as I can tell Yanfly's plugin really doesn't innately change how it works. What it does is add a new functionality step, "flat," which is applied after MV's normal process ((base + plus) * paramRate * buffRate + flat), and allow you to change how parameters are calculated if you so wish. For ATK, DEF, MAT, and AGI, parameters, I made a modification as follows:
Code:
Math.min((base + plus), 999) * paramRate * buffRate + flat
Essentially capping those parameters for players at 999, but allowing buffs and flat to exceed that limit so that the former aren't useless should the player go through the trouble of doping to the maximum.
Unfortunately, this isn't quite what I want: an actor's given parameter, taking into account their Level/normal growth, plus any growth from a consumable, but NOT increases from anything they have equipped, nor the Parameter Rate function.
By default, you have these functions to get actor param plus, which includes item growth effects, the event command that adds parameter for the actor, and the equipments:

JavaScript:
Game_BattlerBase.prototype.paramPlus = function(paramId) {
    return this._paramPlus[paramId];
};

Game_Actor.prototype.paramPlus = function(paramId) {
    let value = Game_Battler.prototype.paramPlus.call(this, paramId);
    for (const item of this.equips()) {
        if (item) {
            value += item.params[paramId];
        }
    }
    return value;
};

Although the function paramPlus gets the growth effects + the equip, it does not add the equip values into the object _paramPlus.

So, what you can do is the following, to get the value you want:

JavaScript:
$gameActors.actor(ActorID).paramBase(ParamID) + $gameActors.actor(id)._paramPlus[ParamID]
This worked wonderfully! I only have one more question: Is it possible to retrieve and store the names of parameters (stats) into variables? I'm trying to make the Common Event as small as possible, and right now I have what's essentially six versions of the same message because I haven't found any way to store parameters' names. It would let me input another \v[n] in the Message box.
Is it possible to retrieve and store the names of parameters (stats) into variables?
$dataSystem.terms.params is an array of the names of your stats. You can grab your elements from it with a script call and use it in your message box
Before I report this thread SOLVED, I thought it only fair I share what exactly I ended up doing, with everyone's help: The first image is one of the items I mentioned making (there's six - one for stat IDs 0, 1, 2, 3, 4, and 6), while the second image is the full Common Event (I spliced two screenshots together to get one image.) Going step by step:
Using Yanfly's Beginning and End Effects plugin, I put
Code:
<After Eval>
$gameVariables.setValue(8, b.actorId());
$gameVariables.setValue(9, 0);
</After Eval>
in each stat booster's Notes. When the item is used, the above sets Variable 8 to the target's Actor ID, and Variable 9 to the desired parameter's ID; in the case of the HP booster, this is 0 (Max HP). Note that this works because it takes place after the item is used, but before the Common Event is run. Next, we have the Common Event itself.
Code:
Control Variable : #0002 Unit Name = $gameActors.actor($gameVariables.value(8)).name()
The Control Variable event command's Script function is used to check Variable 8 from the previous step, and thus store that Actor's name in Variable 2. This ensures the Actor ID variable will always be changed depending on the used item's initial target, and so no duplicates of the process are necessary.
Code:
If: Script : $gameActors.actor($gameVariables.value(8)).paramBase($gameVariables.value(9)) + $gameActors.actor($gameVariables.value(8))._paramPlus[$gameVariables.value(9)] < 999
The Conditional Branch event command's Script function is used with "Else" checked. The script above checks Variable 8 (the item's target's Actor ID), and Variable 9 (the parameter ID, in this case 0, or Max HP), to determine which Actor to reference, and what parameter of theirs to reference. If targeting default MV actor Harold, for example, Variable 8 would be 1, so this item would check Harold's Max HP - specifically the amount he'd have given his current Level (paramBase), and add any bonuses from Growth functions (paramPlus). Per the Condition Branch setting, the event will proceed differently depending on if the result is less than 999.
If less than 999, the following occurs:
Code:
If: Parameter ID < 2
Script: $gameActors.actor($gameVariables.value(8)).addParam($gameVariables.value(9), 5)
Control Variables : #0003 Unit Count = $dataSystem.terms.params[$gameVariables.value(9)]
Text: None, Window, Bottom
:   : \v[2]'s \v[3] was increased by 5!\|
Else
Script: $gameActors.actor($gameVariables.value(8)).addParam($gameVariables.value(9), 2)
Control Variables : #0003 Unit Count = $dataSystem.terms.params[$gameVariables.value(9)]
Text: None, Window, Bottom
:   : \v[2]'s \v[3] was increased by 2!\|
If Variable 9 (Parameter ID) is less than 2 (i.e. 0 or 1, or Max HP or Max HP), then a Script call will use Variable 8 to determine which Actor is the subject, and use Variable 9 to determine which parameter is to be changed, before using the addParam function to increase that Actor's given parameter by 5. Variable 3 (Unit Count) is then set using the Script function to the parameter whose ID matches Variable 9. Using the previous example of Harold, the Show Text event command is then used to tell the player that Harold (Actor 1)'s Max HP (param 0) was increased by 5. If instead Variable 9 was equal to or greater than 2, then the same process occurs, with the exception that the parameter is increased by 2.
Code:
Else
Text: None, Window, Bottom

:   : It won't have any effect.\|
Script: $gameParty.gainItem($gameParty.lastItem(), 1);

End
Finally, if the total of the Actor's Parambase and ParamPlus was NOT less than 999, then a message tells the player the item "won't have any effect," followed by a Script call increasing the player's count of the last item used, through the gainItem and lastItem functions, respectively. Since the "last item used" was the stat booster that triggered the Common Event, it will effectively be refunded.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-get-parameter-values-without-equipment-param-rate.166768/