Xparam and Sparam for Souls Like Stat Upgrade with increased cost [HELP]

So let me make a deep explaination about what I'm doing, I'm trying to make a level up system in my game where the player can level up by using Makha (I'll come up with a cooler name later) For this effect I use a modified version of "Stat Upgrade with increased cost" composed of codes that I took here and there on this forum. The mechanic of this system is that for every time the player choose to upgrade a stat the overall cost rise for every other stat upgrade and he gain a level and the game has 5 main stats Muscles, Endurance, Magic, Agility and Intellect. My game is mostly based on manhwa like solo leveling so there is a rank system F-E-D-C-B-A-S-SS-SSS for every 10 levels the player goes up in ranks so upgrading stat is important but well here is the problem: I want the stat of Intellect to increase both Magical Power and MP regen but I don'tknow how to use Xparam and Sparam together with the code that I took from the tips and tricks.
Here is the code:

<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 8;
// Increase the parameter by this amount.
user._xparamPlus[id] += 0.1;
// Adjust the number of times upgraded by 1.
user._upgradeParam += 1;
// Set the param ID of the stat you wish to adjust.
var id = 7;
// Increase the parameter by this amount.
user._paramPlus[id] += 1;
// Raise the level by + 1
user.changeLevel(user.level + 1)
// Make the user forget the skill.
user.forgetSkill(skill.id);
// Refresh the user.
user.refresh();
</Learn Cost Eval>

<Custom Learn JP Cost>
// Set the param ID of the stat you wish to adjust.
var id = 0;
// Default the user's upgrade parameter times to empty.
user._upgradeParam = user._upgradeParam || 0;
// Adjust the cost of
cost = user._upgradeParam * 200;
</Custom Learn JP Cost>

<Custom Cost Display>
\}Passive\{
</Custom Cost Display>

<Hide in Battle>

I need help in order to continue, Thanks in Advance
Those notetags look like they use Yanfly plugins, and if you have access to the collection, two of Yanfly's plugins should do what you need.



Those notetags look like they use Yanfly plugins, and if you have access to the collection, two of Yanfly's plugins should do what you need.



I know these are the one I use but I don't know why the code does not work
What's the code you're using?
What's the code you're using?
<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 8;
// Increase the parameter by this amount.
user._xparamPlus[id] += 0.1;
// Adjust the number of times upgraded by 1.
user._upgradeParam += 1;
// Set the param ID of the stat you wish to adjust.
var id = 7;
// Increase the parameter by this amount.
user._paramPlus[id] += 1;
// Raise the level by + 1
user.changeLevel(user.level + 1)
// Make the user forget the skill.
user.forgetSkill(skill.id);
// Refresh the user.
user.refresh();
</Learn Cost Eval>

<Custom Learn JP Cost>
// Set the param ID of the stat you wish to adjust.
var id = 0;
// Default the user's upgrade parameter times to empty.
user._upgradeParam = user._upgradeParam || 0;
// Adjust the cost of
cost = user._upgradeParam * 200;
</Custom Learn JP Cost>

<Custom Cost Display>
\}Passive\{
</Custom Cost Display>

<Hide in Battle>
Ah, I had forgotten you posted that code in your opening post. My bad.

Anyway, this code is using tags from the Learn Skill System. If you aren't using that plugin, these obviously won't work. Aside from that, none of this pertains to making your primary stats affect X-params and S-params. Have you read through the help files of those plugins?
user._xparamPlus[id] += 0.1;
I don't know why the code does not work
Because you're not using valid code. There is no such member variable as xparamPlus. In fact, your approach is unfortunately all wrong.

If you look at an Actor in the database, you'll see that the Ex-Parameters and Sp-Parameters are not given values that you just type in. They're set by Traits.

So during gameplay, every time one of those are referenced, the game looks at all of the Traits on the Actor from the database entries for their Actor, Class, Weapons and Armors, adds (or multiplies) them up, and returns the value.

What you want to do can't be done natively because these values are always retrieved from the database when you load a game.

You'll need to look up a plugin that allows you to dynamically change trait values (I believe Galv and Shaz both wrote some, but you can Google it) and incorporate that code into the Yanfly Skill Learn notetags.

Or you can learn skills that have passive states with those Traits added, but then you can only upgrade them a finite number of times according to the skills and states that you add to the database.
@ATT_Turan I didn't even note OP was using non-existent syntax. I kinda glossed over most of that code when I realized it was all pertaining to actually learning skills and not tying secondary params to primary ones. I probably wouldn't have caught it anyway, so thanks for pointing that out.

@Anohe1 Okay, so now that I've been made aware of the issues with your code, I can say that you obviously didn't actually read the help files of the plugins you have at all and merely copy pasted the code and assumed what you could change to get what you want. That code from the Tips and Tricks page is solely for increasing your main params, not the X or S params. The plugins I posted will allow you to do so, but you'll need to use the correct code.

First off, change your above code back to what it originally was. This will set up your stat upgrades with increasing costs. Next, assuming you do indeed have Extra Parameter Formulas and Special Parameter Formulas, you need to use what they provide to tie your X and S params to your main stats in some way. So let's say you want to tie MP Regen % into your Intelligence stat, as you requested. You first need to give your actors an MP Regen trait. Nothing else will have any bearing if they lack that trait.

Assuming that Intelligence is a renamed Magic Attack parameter in your game, open up the Extra Paramater Formulas plugin and find where it says MRG Formula. This is the formula for MP Regen. Click on that and make it look like this:

(base + plus) * rate + flat + (user.mat / 3)

If I'm not mistaken, this should cause your actors to gain an extra 1% of MP Regen per every 3 Intelligence they have. This is just an example, and you can change that number to your precise needs. The end result is that increasing your Intelligence would in turn boost MP Regen.
Sword_of_Dusk and ATT_Turan Thamk you for your help I will try the ideas you gave me tonight

Original thread: https://forums.rpgmakerweb.com/threads/xparam-and-sparam-for-souls-like-stat-upgrade-with-increased-cost-help.149446/