# How to add a cool down to an ability?

**URL:** <https://forum.makecode.com/t/how-to-add-a-cool-down-to-an-ability/2280>\
**Category:** Help\
**Created:** [May 31, 2020, 7:16pm UTC](https://forum.makecode.com/t/how-to-add-a-cool-down-to-an-ability/2280 "2020-05-31T19:16:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DoggoWoof420YT](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DoggoWoof420YT](https://forum.makecode.com/u/DoggoWoof420YT)\
**Post date:** [May 31, 2020, 7:16pm UTC](https://forum.makecode.com/t/how-to-add-a-cool-down-to-an-ability/2280/1 "2020-05-31T19:16:57Z")

</div>

I need help on giving a cooldown to a ability after its use.

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [May 31, 2020, 8:58pm UTC](https://forum.makecode.com/t/how-to-add-a-cool-down-to-an-ability/2280/2 "2020-05-31T20:58:50Z")

</div>

Something like this?

> **[cool down](https://arcade.makecode.com/00653-47544-13166-69726)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

This is keeping track of the last time the event was fired, and only letting it happen if its been at least 2 seconds (2000ms). The game time block is found in the game category.

---

<div class="post-metadata">

**Author:** ![DoggoWoof420YT](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DoggoWoof420YT](https://forum.makecode.com/u/DoggoWoof420YT)\
**Post date:** [May 31, 2020, 9:33pm UTC](https://forum.makecode.com/t/how-to-add-a-cool-down-to-an-ability/2280/3 "2020-05-31T21:33:57Z")

</div>

I just tried it and it sorta works, although I think I may be doing it wrong because yea the ability doesn’t activate in the specified time but afterwards I can use it but then be able to use it again without it’s specified time.

---

<div class="post-metadata">

**Author:** ![DoggoWoof420YT](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DoggoWoof420YT](https://forum.makecode.com/u/DoggoWoof420YT)\
**Post date:** [May 31, 2020, 9:36pm UTC](https://forum.makecode.com/t/how-to-add-a-cool-down-to-an-ability/2280/4 "2020-05-31T21:36:31Z")

</div>

wait nvm I got it right I forgot to add something 😛

---

<div class="post-metadata">

**Author:** ![Yash](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Yash](https://forum.makecode.com/u/Yash)\
**Post date:** [December 12, 2024, 5:46pm UTC](https://forum.makecode.com/t/how-to-add-a-cool-down-to-an-ability/2280/5 "2024-12-12T17:46:00Z")

</div>

its not working for me for some reason.
