dynamic lore change of armor

Hello, while trying to learn datapacks i wanted to recreate a set bonus effect that also changes the lore of armor pieces when all equipped and when taken off, i managed to get it to work when equipping, but my issue comes with unequipping, when i take off an armor piece, all other armor pieces "reset" back to their original lore but the armor piece i unequip still says its set bonus lore. i know its because im targeting the armor slots and im literally taking off the armor from the slot, but i also cant think of another way to do it.

Continue to help post