You have the rotation animation in the wow api but not sure if it will work while in combat.
This forum post discusses it when it first arrived onto the scene.
https://www.wowinterface.com/forums/...ad.php?t=35104
And this wowpedia page lists what is known about the Animation System - currently no real details
https://wowpedia.fandom.com/wiki/Widget_API#Animation
And this is a link to the latest wow api in case something in wow already does something similar to what you want so you can see how they did it.
https://www.townlong-yak.com/framexml/live
Unless someone has played with animation enough to assist you may have to do the research yourself. Good Luck.