From the wiki:
Returns 1 if the calling reference is currently being affected by the specified magic item (spell, enchantment or potion).
Technically, an ability is a spell and is under spells. So the above description is a bit broad.
SCN 1AbGhostNPCQuestScriptshort DoOnceBegin GameMode If ( DoOnce == 0 ) Player.AddSpell AbGhostNPC Set DoOnce to 1 Return ElseIf ( DoOnce == 1 ) Set DoOnce to 2 Return ElseIf ( DoOnce == 2 ) If ( Player.IsSpellTarget AbGhostNPC == 0 ) Message "Doesn't Have Ability" Set DoOnce to 3 ElseIf ( Player.IsSpellTarget AbGhostNPC == 1 ) PlaySound AMBAyleidWellLP Message "Has Ability" Set DoOnce to 3 EndIf EndIfEnd