Hey man, you're not alone. Quite a few people (myself included) didn't perform our best in today's exam either. Personally, I can't relate to setting the goal of achieving state rank (I'm not good enough in 3U for that HAHAHAHA) but I can certainly understand not meeting your goals. :/
I agree with the fact that your performance in this exam doesn't reflect on your overall math ability! After all, the external exam results will only be based on how well you performed on
one day, in a time period with many other exams and the very huge hype that's placed on the HSC. It's a poor measurement of your math ability o if your HSC exam falls short of your goals, seriously don't let it make you doubt yourself! I've briefly seen you around on the forums and I can tell you're someone passionate about mathematics.
I believe you did well either way, an E4 itself already scales good!
Hope you are feeling better