Change weapon parameter in game

I'm creating a level UP system for the weapons in my game, initially the weapon comes in the default form of the database, inside the game I have a function to add upgrades +1 +2 +3... Every + the weapon will receive a increase in your ATK attribute for example.

I would like to know if there is any script to change the atk value of weapons. I tried to change the character's atk value but it's not working very well due to the amount of weapons.

In short, I want a command that adds +3 atk to my weapon when it upgrades to +1.

Below is the code I tried to use but it didn't work.
Code:
$gameActors.actor(1).addParam(2, 3);

To work correctly what I want, I need to change the atk value of the weapons, directly in the database.

My project will only have unique weapons, so I have no problem changing the global parameter.

I want to avoid plugins that do this, because my project is completely made for mobile in a customized way.

I appreciate any help
I am also curious how you could do this in a simple/easy way.

My way is probably clunky. I would just create multiple versions of each weapon in the database. So there are upgraded versions with the correct upgrades. Then, when the "upgrade" happens, I would just swap the weapon behind the scenes. The player will just know that their +1 Sword is now a +2 Sword after upgrade even though the +1 Sword in the database never changed. But that also means you have to name each upgraded version of the weapon something different.

Doing this also allows you to give an upgraded version of the weapon at any point in the game, if you decide to do that.

Again, there might be a scripting way to do this, but I would think the multiple versions and just swapping them would also work.

I will watch for better answers too. Thanks!
I am also curious how you could do this in a simple/easy way.

My way is probably clunky. I would just create multiple versions of each weapon in the database. So there are upgraded versions with the correct upgrades. Then, when the "upgrade" happens, I would just swap the weapon behind the scenes. The player will just know that their +1 Sword is now a +2 Sword after upgrade even though the +1 Sword in the database never changed. But that also means you have to name each upgraded version of the weapon something different.

Doing this also allows you to give an upgraded version of the weapon at any point in the game, if you decide to do that.

Again, there might be a scripting way to do this, but I would think the multiple versions and just swapping them would also work.

I will watch for better answers too. Thanks!
Your idea also crossed my mind, having several versions of the same weapon would solve the problem, but in my case I would have hundreds of other problems, my project is fully customized with unique weapons and manual HUDs, if I duplicate 3 weapons for example, I would have to redo all manual work for the 3 versions, something totally unfeasible. If it is not possible to change this parameter directly on the weapons, I will have to abandon this idea and create just a character lvl up system, as this is simpler to do.
I looked in the RPG Maker MZ Script Call Reference and saw this:



$dataWeapons[id].params0

I believe this one corresponds to the Attack parameter of the weapons.

I wonder if you could change that one for your upgrade. I haven't played around with that at all, but I will try it now if no one else responds with a definitive answer.
Why not try this:
write this on your weapon note
<JS Parameters> ATK = 0 + $gameVariables.value(1); </JS Parameters>

in this case the variable 1 is responsible for the attack of your weapon, just add or decrease it,
But I think you need the visustella plugins to work.
Well, you can control weapon and armor parameters through the VisuStella Items and Equip Core.

<JS Parameters>
ATK = $gameVariables.value(1);
</JS Parameters>

Putting that notetag in a weapon's note box should tie that weapon's attack value to a variable (in this case, variable 1). You can then manipulate it by changing the referenced variable.
Why not try this:
write this on your weapon note
<JS Parameters> ATK = 0 + $gameVariables.value(1); </JS Parameters>

in this case the variable 1 is responsible for the attack of your weapon, just add or decrease it,
But I think you need the visustella plugins to work.
Now I understand the function of this code, it seems that the problem is solved. Thanks for explaining, I'll try.
Well, you can control weapon and armor parameters through the VisuStella Items and Equip Core.

<JS Parameters>
ATK = $gameVariables.value(1);
</JS Parameters>

Putting that notetag in a weapon's note box should tie that weapon's attack value to a variable (in this case, variable 1). You can then manipulate it by changing the referenced variable.
Now I understand the function of this code, it seems that the problem is solved. Thanks for explaining, I'll try.
@Sword_of_Dusk and @darklugia1997
It worked perfectly, I tried to use this function earlier but I didn't understand exactly what it was about. Thanks for explaining clearly.

@kvngreeley
Problem solved!
@Sword_of_Dusk and @darklugia1997
It worked perfectly, I tried to use this function earlier but I didn't understand exactly what it was about. Thanks for explaining clearly.

@kvngreeley
Problem solved!
my english is not very good, so my explanation was confusing hahaha, but I'm glad you made it
I was hoping for a non-plugin solution since I haven't explored plugins yet. But I will save this for when I do!

Thanks!
I was hoping for a non-plugin solution since I haven't explored plugins yet. But I will save this for when I do!

Thanks!
I also didn't want to use any plugins, but as I already use VisuStella and Equip Core in my project, it fit like a glove. This plugin is indispensable in basically every RPG Maker project.
@cropots You're welcome, friend. I use the MV version of the Equip Core, so I figured that bit of code should work for you too.

Original thread: https://forums.rpgmakerweb.com/threads/change-weapon-parameter-in-game.145399/