There are world triggers for "entity tick update," "player tick update," and "world tick update" that you can use. Just check if a random number between 1 and 10, 100, 10, 100, 1000 etc (depending on how rare you want it to be) is equal to 1, and if you want a cooldown, you can make a world variable clock and just check at the beginning of the procedure if the cooldown is done.
There are world triggers for "entity tick update," "player tick update," and "world tick update" that you can use. Just check if a random number between 1 and 10, 100, 10, 100, 1000 etc (depending on how rare you want it to be) is equal to 1, and if you want a cooldown, you can make a world variable clock and just check at the beginning of the procedure if the cooldown is done.