How to rotate cat bone pivot only?

After export my CAT character to unreal engine 4 with shared bone settings, when playing animation my character will get missed up, for bones of target skeleton bone has different pivot rotation than my CAT character(see attachment). after further inspection, I realized the pivot rotation of nearly every single bone is mismatched.

The problem is, I can't simply rotate the pivot of CAT bone, the bone will rotate with the pivot. I'd like to know if there is a way to change the CAT bone pivot via max script, please help me.