Arm follow camera script is broken with torso animation (need math help)

  1. What do you want to achieve? I want arms and neck to follow mouse (for gun script)

  2. What is the issue? Rotations work perfectly fine if torso is not animated but when I animate torso (like in screenshot) arms and neck get messy

EDIT: SOLVED

Still cant find solution any idea how to fix?