For WoW CLASSIC
If you want to have a PowerShift macro for cat form and don't want to end up in caster form when the Global Cooldown (GCD) is active then you could use the following macro.
Im definitely not a macro expert and never created one, but somehow this works. If it looks stupid but works, it ain't stupid ;-) I found the original script on a forum, but it didn't work as it should be. Let me solve your frustration if you have the same problem =D.
/script local gcd=GetSpellCooldown("Cat Form"); if gcd=0 then CancelPlayerBuff("Cat Form") end;
/stopmacro [stance:1]
/cast Cat Form(Shapeshift)
/cast !Cat Form
/startattack