Triggers. You make each spell in a separate spell book but the spell books have the same common orders.
When the hero aquires the item, you add the spell book holding the corosponding ability to the hero. It will merge the multiple abilities into the same spell book.
You can level up the abilities with triggers as well by setting the level of the actual use ability (one in spell book) and it will increase the ability level.