Kira, Great Glass-Spinner

I'm trying to code Kira, Great Glass-Spinner. Granting the ability to other creatures is easy, but how can I make sure it only gets triggered once per turn?
- Code: Select all
<TRIGGERED_ABILITY resource_id="1" auto_skip="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
<TRIGGER value="BECAME_TARGET" simple_qualifier="self">
return SecondaryObject() ~= nil
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local target_spell = SecondaryObject()
if target_spell ~= nil then
target_spell:CounterSpell()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>