not in one but this would work
while (true){
while (skillCooldown(skillName) != 0L) { thread.sleep (50); }
UseSkill (skillName,true,false);
}
obviously either replace skillName with the name, or send it as a parameter. if you send it as a parameter bear in mind that as it is it will never exit that loop or do anything else than cast that skill over and over.