Heard of custom NBT tags before? Anyone?? You can do a lot with those, especially when we are talking about items in general.
Use $item->setCustomName to get enchantment name and set what have enchant to do by entity damage event
This does not really add an enchantment. This only seems to have an enchantment on an item, and this is not maintainable. This is not to be kept a secret, but I don't think it is reasonable that anyone who understands the nature of reflections needs someone else to write the code for him.
Everyone is telling us to use NBT, how does it work? I tried to find some spruces but non of them are relevant to it :/
https://forums.pmmp.io/threads/how-do-you-properly-set-nbt.1182/ basically like a hidden storage for data that's bounded to it