Grade A Kill's is good. Except this is the one I usually use. It's also a bit easier. Make a dummy item, like for example, Potion of Healing. Change its name, tooltip, price, and icon to the ones you'd want for the ability. Then just add the dummy item to the unit you want to have selling the ability. Then you make the trigger. It should look something like...
Events:
Unit - A unit Acquires an item
Conditions:
(Item-type of (Item being manipulated)) Equal to Learn Fireball
Actions:
Item - Remove (Item being manipulated) (This one is important if you don't want the dummy item to stay in your inventory after purchasing)
Unit - Add Fireball to (Hero manipulating item) If you don't want it to be a hero, then just do
Unit - Add Fireball to (Triggering unit)
You can also use the Conditions to limit the units that the trigger applies to. Like for example, only units owned by allies of player 1 red, etc.