MV Equipment that regenerates a flat amount of MP and stacks with multiple copies.

I have a plugin that lets me have multiple copies of an equipment slot (ex: multiple hats). I want to make a piece of equipment where, for every one you have equipped, you regenerate 10 mp every turn. How do I do this?
Can you show the properties of the item? That's a good place to start.
I guess it's usually done with Yanfly plugins, make that equipment give passive state that has (change X to id or armor):

<Custom Regenerate Effect>
const armorCount = user.armors().reduce((t, a) => t + (a.id === X ? 1 : 0), 0);
user.gainMp(armorCount * 10);
</Custom Regenerate Effect>

Original thread: https://forums.rpgmakerweb.com/threads/equipment-that-regenerates-a-flat-amount-of-mp-and-stacks-with-multiple-copies.183000/