Setting such a simple thing every tick is not a very good way of doing it.
You should do something like:
on click
-- mouse is over sprite ---> set cursor frame to id
--else --> set cursor frame to 0
There is no need for an every tick event here and you should avoid using those events as much as possible and just use it when you have to.
That sounds simpler than what I did, thank you! But it is pretty late into the development and the deadline for my game is litteraly tomorrow, so I'm keeping it as it is for now as long as it works. I'll definitely try this on my next project.