base code for upgrading spells