Need help defensive macro

I’m trying to make a macro to enter Bear Form and use some abilities for PvP, but i’m not sure how castsequence works.

The idea is to go to Bear Form, cast Heart of the Wild, then cast Frenzy Regeneration, Barskin and another Frenzy Regeneration.

Anyone knows if this is something that can be made, or maybe not ?