MV Two questions about Scripts for weapons

i'm needing help with two scripted related things about the weapons in the game, they are different stuff, so i will separate it with an spoiler

Spoiler: First thing
i made an thread a while ago asking how could i remove Magic Attack and Magic Defense from the status menu, since i'm not using any magical element on my game, and in the end i manage to get rid of it, at least that was what i thought, because some days ago i was checking my weapons menu, and them realize that these two guys are still haunting me
1649957847898.png

so, how can i remove it from the weapons menu now?

Spoiler: Second thing
i really want to know an script call for get the weapon that the party leader have equipped, them turning it into an variable or something, for some reason, the way you do it in vanilla RPG Maker sucks, because you can't store it as an game data variable, you need to create an giant conditional branch for checking first of all, who is the party leader, and them checking with every equippable weapon to see if is whether or not equipped
For the second thing you could use e.g. the following script, which will store the id of the equipment assigned at equipment slot 0, which is usually the weapon slot in variable 1 if the leader has a weapon assigned and will store the value 0 in variable 1 if the leader does not have a weapon assigned.
Spoiler: Script
let leaderWeapon = $gameParty.leader().equips()[0];
if( !leaderWeapon )
$gameVariables.setValue(1, 0);
else
$gameVariables.setValue(1, leaderWeapon.id);

For the first problem the easiest answer would be looking for a plugin that can remove those stats from the status window.
For the second thing you could use e.g. the following script, which will store the id of the equipment assigned at equipment slot 0, which is usually the weapon slot in variable 1 if the leader has a weapon assigned and will store the value 0 in variable 1 if the leader does not have a weapon assigned.
Spoiler: Script
let leaderWeapon = $gameParty.leader().equips()[0];
if( !leaderWeapon )
$gameVariables.setValue(1, 0);
else
$gameVariables.setValue(1, leaderWeapon.id);
Thanks, it worked! now i only need to get rid of M.Attack/Defense
Thanks, it worked! now i only need to get rid of M.Attack/Defense
Your welcome.

If you are using vanilla MV equipment menu without any plugins that already modify it, paste the following code into a text editor, save it as a .js-File with any not yet used name into your projects plugin folder and activate the new plugin in the plugin manager:

Spoiler: Code
JavaScript:
var drawEquipStatusItemWithoutMagic = Window_EquipStatus.prototype.drawItem;
Window_EquipStatus.prototype.drawItem = function(x, y, paramId)
{
   if( paramId === 4 || paramId === 5 ) // Skipp magic parameters
       return;
   if( paramId > 5 ) // Shift parameters after magic up
      y -= 2 * this.lineHeight();
   drawEquipStatusItemWithoutMagic.call(this, x, y, paramId);
}

You could potentially add that code just to a script call, but then the script needs to run whenever the player presses "New Game" or loads a save file or at least when the game boots up, which might be tedious to setup.
This might even work if you have plugins installed that already modify the equipment menu, but I'm not sure about that.
Your welcome.

If you are using vanilla MV equipment menu without any plugins that already modify it, paste the following code into a text editor, save it as a .js-File with any not yet used name into your projects plugin folder and activate the new plugin in the plugin manager:

Spoiler: Code
JavaScript:
var drawEquipStatusItemWithoutMagic = Window_EquipStatus.prototype.drawItem;
Window_EquipStatus.prototype.drawItem = function(x, y, paramId)
{
   if( paramId === 4 || paramId === 5 ) // Skipp magic parameters
       return;
   if( paramId > 5 ) // Shift parameters after magic up
      y -= 2 * this.lineHeight();
   drawEquipStatusItemWithoutMagic.call(this, x, y, paramId);
}

You could potentially add that code just to a script call, but then the script needs to run whenever the player presses "New Game" or loads a save file or at least when the game boots up, which might be tedious to setup.
This might even work if you have plugins installed that already modify the equipment menu, but I'm not sure about that.
Yay! thanks!! it worked!, this thread can be closed now

Original thread: https://forums.rpgmakerweb.com/threads/two-questions-about-scripts-for-weapons.146750/