Stat increasing skill

Hello everyone, I am thinking of making a skill increase the user base off enemy stats (could increase the user by 2% of their stats for example). Looked into changing parameters (but that requires it to be a certain actor) and looking into adding a buff but dont know how to make it a variable base off enemy stats.

For info: I am trying to make a Gluttony skill. I am using VisuStella plugins.
Hi, I am not sure what the request is, but I'm guessing that you want a skill that increases the user's stats (HP, MP, ATK, etc...) by 2% of the enemy's same stats...? So the user gains 2% of the enemy's HP, 2% of the enemy's MP, 2% of the enemy's ATK, and so forth...?
Hi, I am not sure what the request is, but I'm guessing that you want a skill that increases the user's stats (HP, MP, ATK, etc...) by 2% of the enemy's same stats...? So the user gains 2% of the enemy's HP, 2% of the enemy's MP, 2% of the enemy's ATK, and so forth...?
Yes, I have seen the normal buff but not based off enemy stats
VisuStella's Core Engine has notetags to affect parameters and the Battle Core has notetags that happen when you use a skill.

So you can give the skill the notetag:
Code:
<JS Post-Apply>
user.gluttony = Math.round(target.atk * .02);
user.addState(42);
</JS Post-Apply>
where 42 is the ID of your gluttony state. Then, in the notetags for the state,
Code:
<JS Atk Plus: user.gluttony>

<JS On Erase State>
delete user.gluttony;
</JS On Erase State>

If you want the state to do something other than 2% of the target's attack, you can rename the notetag and change the math in the state's notetag accordingly.
VisuStella's Core Engine has notetags to affect parameters and the Battle Core has notetags that happen when you use a skill.

So you can give the skill the notetag:
Code:
<JS Post-Apply>
user.gluttony = Math.round(target.atk * .02);
user.addState(42);
</JS Post-Apply>
where 42 is the ID of your gluttony state. Then, in the notetags for the state,
Code:
<JS Atk Plus: user.gluttony>

<JS On Erase State>
delete user.gluttony;
</JS On Erase State>

If you want the state to do something other than 2% of the target's attack, you can rename the notetag and change the math in the state's notetag accordingly.
if I want to add other than atk would it be like this?
<JS Post-Apply>
user.gluttony = Math.round(target.atk * .02);
user.gluttony = Math.round(target.def * .02);
user.gluttony = Math.round(target.matk * .02);
user.gluttony = Math.round(target.mdef * .02);
user.addState(42);
</JS Post-Apply>
No, because you're using the same variable on every line. If you say user.gluttony is equal to 2% of the target's defense, then it is.

If you say user.glottony is equal to 2% of the target's matk, then it is.

A variable can't mean multiple things. You would have to make each one a unique name.

Also, none of those lines are actually adding anything to the actor.
No, because you're using the same variable on every line. If you say user.gluttony is equal to 2% of the target's defense, then it is.

If you say user.glottony is equal to 2% of the target's matk, then it is.

A variable can't mean multiple things. You would have to make each one a unique name.

Also, none of those lines are actually adding anything to the actor.
so that code can only work for one or I would have to make a unique name for each "user.(Insert)"? Also this doesnt give the user the extra stats?
I suggest you go back to my previous posts and read through the various notetags. Look them up in the plugin documentation and read what they do. The Post-Apply is from Battle Core, On Erase State is from Skills and States, and JS Param is from the Core.

It's fine that you don't know JavaScript to be able to come up with the code yourself, but you should understand mechanically what everything is doing. It should be very clear that none of the lines from your post are giving the user extra stats.

so that code can only work for one or I would have to make a unique name for each "user.(Insert)"?
I already answered this, I dunno what the outstanding question is 😛
I'd like to suggest you just try it with one stat first, then add another, and by then you'll probably understand how it works.

so that code can only work for one or I would have to make a unique name for each "user.(Insert)"? Also this doesnt give the user the extra stats?

To echo ATT_Turan, yes, you would need a unique name for each of the parameters. And similarly, in the state you would need to add each using the respective notetags, e.g. <JS Atk Plus: user.glutATK>, <JS Def Plus: user.glutDEF>. Make sure to delete them all under the <JS On Erase State> notetag, too.

It's understandable that it feels daunting, but the only remedy to that is to (and I mean no disrespect) learn to read the documentation.
I suggest you go back to my previous posts and read through the various notetags. Look them up in the plugin documentation and read what they do. The Post-Apply is from Battle Core, On Erase State is from Skills and States, and JS Param is from the Core.

It's fine that you don't know JavaScript to be able to come up with the code yourself, but you should understand mechanically what everything is doing. It should be very clear that none of the lines from your post are giving the user extra stats.


I already answered this, I dunno what the outstanding question is 😛
I'd like to suggest you just try it with one stat first, then add another, and by then you'll probably understand how it works.



To echo ATT_Turan, yes, you would need a unique name for each of the parameters. And similarly, in the state you would need to add each using the respective notetags, e.g. <JS Atk Plus: user.glutATK>, <JS Def Plus: user.glutDEF>. Make sure to delete them all under the <JS On Erase State> notetag, too.

It's understandable that it feels daunting, but the only remedy to that is to (and I mean no disrespect) learn to read the documentation.
After taking a look, I thought of a simpler way I think. I would make a common event if

"$gameParty.members()[n].addParam(id, value)"

If I dont give this state is not turned off until after battle, I can increase the parameter of the actor by a value (still trying to figure out which parameter id and if I can add a % value)
After taking a look, I thought of a simpler way I think. I would make a common event if

"$gameParty.members()[n].addParam(id, value)"

If I dont give this state is not turned off until after battle, I can increase the parameter of the actor by a value (still trying to figure out which parameter id and if I can add a % value)
Yes, there are more ways that lead to Rome... but just to comment, judging from your initial description, you don't want to add a percentage value. You want to add a value calculated as a percentage of the enemy's stats - so by the time you add it, it is a flat value.

Original thread: https://forums.rpgmakerweb.com/threads/stat-increasing-skill.172876/