DASH (mechanic)

I need help adding Haste to the Dash mechanic. I've already tested the card and it only returns to hand when the Dash cost is paid. If anyone can help me out I would greatly appreciate it.
Here is the code for Dash.
- Code: Select all
<UTILITY_ABILITY qualifier="Alternate">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dash {3}{B} (You may cast this spell for its dash cost. If you do, it gains haste, and it's returned from the battlefield to its owner's hand at the beginning of the next end step.)]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Précipitation {3}{B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Rapidez {3}{B}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sturmangriff {3}{B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Accelerare {3}{B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[疾駆{3}{B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[질주 {3}{B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Рывок {3}{B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Investida {3}{B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[掩袭{3}{B}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[掩襲{3}{B}]]></LOCALISED_TEXT>
<COST mana_cost="{3}{B}" type="Mana" />
<COST type="Generic">
<PREREQUISITE>
return true
</PREREQUISITE>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_CardPtr(0, EffectSource())
delayDC:Protect_CardPtr(0)
MTG():CreateDelayedTrigger(1, delayDC)
end
</RESOLUTION_TIME_ACTION>
</COST>
<ABILITY_TEXT tag="ALTERNATE_COST_PAY_DASH" />
</UTILITY_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" resource_id="1">
<CLEANUP simple_cleanup="EndOfTurn" fire_once="1" />
<TRIGGER value="SPELL_RESOLVED">
return TriggerObject() == EffectDC():Get_CardPtr(0)
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local delayDC = EffectDC():Make_Chest(1)
MTG():CreateDelayedTrigger(2, delayDC)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="2" priority="-1">
<CLEANUP fire_once="1" />
<TRIGGER value="BEGINNING_OF_STEP">
return MTG():GetStep() == STEP_END_OF_TURN
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():PutInHand()
end
</RESOLUTION_TIME_ACTION>
<AUTO_SKIP no_effect_source="1" />
</TRIGGERED_ABILITY>