component altering enchantment (theory)
is it possible to make an enchantment that adds/removes/modifies the components of the item in way that the modified components get removed when the enchantment is removed with girndstone? i think it would be easy to set something up with ticking enchantment or advancement that applies item modifier that sets components once (and some custom tag to mark if for preventing repeating commands) but idk how would i detect if there was an item that had enchantment but it does not anymore but it still has components that need to be reverted to non enchanted state, imo it would be possible with advancement that detects if the item has the tag and at the same time does not have the enchantment, but im not sure if thats the best possible way to do it. i assume someone tried to solve this problem before and im just looking for possible alternate solutions or conformation that this will work/is optimized