The 's' switch is for demo only. You can do like so:

//set $+(-su,$rand(5,9)) %testu foo

Or, if it's helpful to have the variable contain the time remaining in the cooldown:

//set -sz %testz $rand(5,9)