Need help with New Upgrading items

With the anvil prop, I think there is a good reason to make an item upgrade.
I was thinking when you go and use an anvil (Button) You would teleport to an area that has buttons for every weapon and if you had two of any type of the same weapon the button would activate (They are deactivated) If you press it I would run item granters and checks, and a trigger would use block variables
for the item type (common = 1, uncommon = 2 etc.) the variables would add up and if it was 2 uncommon zappers, uncommon = 2, 2x2 = 4 and 4 = epic so two uncommons is an epic, so common and an epic is legendary… got any idea how to do this?

I don’t think you can make a weapon’s rarity one level down or above. Do you mean increasing the damage accordingly to another level? You can just allow a player to have a damage modifier and whatever weapons the player uses will have increased damage.

No, I mean deleting two items and replacing them with a new item. the item will be different depending on the items you use to get it.,

Are you asking how to do it, making a guide on how to do it, or suggesting something to be added?