Upgrading an Item which upgrades a Weapon

Basically in this example scenario, I have a Sword, I have a gem which adds ATK+5 to the sword and a Scroll that adds ATK+5 to the gem.
So what would happen is, you can upgrade the gem with the scroll to change the gem from +5 to +10, you would then upgrade the sword with the new upgraded gem. Is that possible?

Right now I am able to upgrade the sword with the gem but when I try to upgrade the gem with the scroll I get a message that says:

Cannot read property '2' of undefined.

In the item note boxes I have:

Gem....

<menu category: test>
<Upgrade weapon type: 1>
<upgrade effect>
ATK: +5
</upgrade effect>

Scroll....

<menu category: test>
<Upgrade item type: all>
<upgrade effect>
ATK: +5
</upgrade effect>

Am I missing something? how come the gem works on the sword but the scroll wont work on the gem?

Please note that it says <menu category: test> because I was testing the creation of a menu category and that part works fine. They appear in that cat.
I'd try using an item synthesis plugin instead for upgrading the gems. Then it plays like, if you combine the ATK+5 gem and the ATK+5scroll, you get an ATK+10 gem that you can attach.

Pretty sure the upgrade plugin doesn't have a case for upgrading an upgrade item; it'd be like, nested upgrades. o-o;
I'd try using an item synthesis plugin instead for upgrading the gems. Then it plays like, if you combine the ATK+5 gem and the ATK+5scroll, you get an ATK+10 gem that you can attach.

Pretty sure the upgrade plugin doesn't have a case for upgrading an upgrade item; it'd be like, nested upgrades. o-o;

Yeh I guess I could do it that way. The reason why I wanted to do it is because with the Upgrade plugin every item has the upgrade button attached to it and I can't seem to remove it, even if I set the slots to zero there's still an upgrade button so I figured I'd try to make use of it on items lol. It's a shame really, would have been good to do it as I intended.
Rather than starting a new thread, was wondering if anyone knew how to add in durability to an attack formula?

I have the default a.atk * 2 but I also want it so the durability adds some damage but as the durability drops from 100 the damage decreases too.
I'm not sure what the code is for durability if there even is any?

Original thread: https://forums.rpgmakerweb.com/threads/upgrading-an-item-which-upgrades-a-weapon.92593/