Checking the spell being cast does sound quicker. You just need to create your own DynamicData spell name element like:
Code:
<Text Name="SpellName" DynamicData="/GameData.Spells.Casting" LocalText="NoSpell" Size="0,0" Visible="false" OnShow="do_checking_based_on_LocalText/>
Replace
OnShow with actual code that checks for the LocalText matching a pet spell name.