I suggest that you try a better-absorbed form of Mg such as citrate and/or especially glycinate.
Is the problem with your nerves or connective tissue?
Getting enough vitamin C--several grams per day in divided doses? I hear it is involved in production of collagen along with being an important antioxidant, etc.
I suppose glucosamine sulfate would be another to consider for connective tissue support.
A close, middle aged female friend had a long history of pulling muscles, etc from just vacuuming the carpet, etc. She'd be off to the chiropractor every month.
Thankfully this is much improved with some combination of detox plus supplements. She rarely pulls a muscle now.