How to change bone indices?

Hi, I’m re-importing a skeleton during modding process and the bone indices are wrong.
Because of this some of the animations dont work properly because they rely on bone indices.

How can I change this? I can’t find a way to do it in any of the 3d tools (Max, Blender) as they sort bones at their own will