Rotating a bone based on a different part's orientation

Hello everyone! I’m not great at introductions, so I’ll get right to the point, but thank you in advance for your time!

I’m the main scripter for a game with custom, non humanoid-shaped characters. I have a system that manipulates a character’s articulations to make it (among other things) turn his head to the left. It used to be easy with Motor6D since, in my experience with two different groups, they always are all oriented the same way, which means no matter the motor I altered, if I rotate around an axis, the way it turns will be the same no matter the motor.

However, in my current group, we recently switched to Bones instead of Motor6D. For the most part on my end, it works the same, except for one thing: each bone’s default orientation is to look towards the part it connects to, meaning each bone has its definition of “turning left” which is different from the character’s left.

That’s for the context, so here’s the question: How to I apply a rotation that goes a certain way according to a different part’s orientation? How do I make a bone which isn’t aligned with the character’s HRP rotate towards the left of the character?

I know it’s a pretty complicated question, so thank you in advance if you got anything!