How Would I Add Magic Attack & Defense As Additional Values To Attack & Defense Through Yanfly Base Parameter Plugin?

I'm currently trying to implement a way to add Magic Attack & Defense to regular Attack & Defense, but as additional values so I can just have a simple ATK and DEF stat, but have MDF and MAT act more like sub stats. I'm currently using Yanfly's Base Parameter plugin, and I'm trying to implement it through the formulas since it 's a lot simpler. An example for how I want it to work is, the user has 100 DEF, and 40 MDF. So when they take damage, it's reduced by an additional amount based on their MDF. Essentially like a resistance stat. But I also want the same but vice versa with ATK and MAT, except MAT acts more like a Pierce stat (additional damage). Any help?
I don't really get how these things are related to the Base Parameter Control. That plugin modifies how the parameters are calculated.

What you're talking about is the mechanical effect the parameters have in game, which you already control. The things you're describing sound like you would just put it into your damage formulae for skills.
I don't really get how these things are related to the Base Parameter Control. That plugin modifies how the parameters are calculated.

What you're talking about is the mechanical effect the parameters have in game, which you already control. The things you're describing sound like you would just put it into your damage formulae for skills.
I'm using Yanfly's Damage/Armor Scaling Core so I only had to add ATK to the skill formulas. I want is to add MAT and MDF to those values through the plugin formula to essentially turn MAT and MDF into sub stats that increase and decrease damage. But I'm not sure how to modify the plugins formulas to combine the 2 parameters to do that since I'm not used to coding.
You'd add it to the parameter formula in the plugin parameters.

So the ATK formula says (base + plus) * paramRate * buffRate + flat
You'd change it to (base + plus) * paramRate * buffRate + flat + user.mat

And the same thing with DEF and mdf.
You'd add it to the parameter formula in the plugin parameters.

So the ATK formula says (base + plus) * paramRate * buffRate + flat
You'd change it to (base + plus) * paramRate * buffRate + flat + user.mat

And the same thing with DEF and mdf.
That's alot simpler than I thought it would be thanks. If I wanted to make it based on a percent of mat, would I just replace "user.mat" with something like "0.10 * user.mat"?
Yup.

Although you may want to put that inside of Math.round() to make sure it sticks with integers.
Yup.

Although you may want to put that inside of Math.round() to make sure it sticks with integers.
Got it, so something like
+ math.round(0.10 * user.mat)
Math, like I typed it, not math. Everything in code, from the damage formula box in RPG Maker on up, is always case sensitive.
Math, like I typed it, not math. Everything in code, from the damage formula box in RPG Maker on up, is always case sensitive.
Oh alright. Sorry for the mix up

Original thread: https://forums.rpgmakerweb.com/threads/how-would-i-add-magic-attack-defense-as-additional-values-to-attack-defense-through-yanfly-base-parameter-plugin.156795/