You answered your own question, you simply make a trigger script which orders the unit to cast the spell on itself, at a position or targeting a widget.
Basically issue the unit you want to cast the ability an order of the orderstring of the ability or its related integer.
If you are using GUI (which generally is not advisable), it is a section of the unit actions which issue orders to a unit with some form of target. There should be 3 of them in total. The order you choose with them is the spell which your custom spell is based upon.