Help scaling a setup


I have this setup in my rig where a couple of extra joints are used to simulate some muscle movements. The joint is scaled based on the proportion between the distance between the two joints and the original distance between them, and there is an aim constraint to make the first joint always aim at his child. The setup is working perfectly fine but I have some problems when I add a global scale to my rig. I’ve tried something to compensate but I’m definitely missing something here.

Thank you to whoever will help me and sorry for the twisted explanation but English is not my first language.