I apologise for the fairly messy handwriting (I'm not a particularly neat or fancy writer), and I decided to go Pen and Paper since it looks much neater than writing it up on the computer.
I just used basic Algebra (Year 7 level really ;I) and rearragned everything to Base =
Also, to speed things up, I skipped some steps (as in I didn't show how I moved each and every single one of the terms around.). If you can't follow it, I'll scan over a copy with every step.
Original Formula for calculating the actual stat for non-HP.
Formula for calculating the actual stat for HP.