The moderation process doesn't take into account your school rank. It considers your own final rank relative to your cohort. For example, if your final rank for one of your subjects is 1/20, this means that your Assessment Mark (which contributes 50% towards your final mark for that subject) will be adjusted to equal the highest Examination Mark of any student in your cohort. If the highest Examination Mark for that subject ends up being 90, you will receive 90 as your Assessment Mark. Similarly, if your final rank is 20/20, your Assessment Mark will be adjusted to equal the lowest Examination Mark of any student in your cohort. If the lowest Examination Mark for that subject ends up being 65, you will receive 65 as your Assessment Mark.
The HSC exams are worth 50% of your final mark for your respective subjects, not to mention the fact that your marks in your HSC exams are determined based on your own performance, meaning that they are not affected by your school rank/cohort. Because of this, they constitute a great opportunity for you to make a significant difference and maximise your chances of achieving an ATAR above 90, even if your internal ranks are not as good as you would've wanted them to be. However, it is imperative that you do your utmost to perform to the best of your abilities in the HSC exams. You will likely need at least band 5's (preferably high band 5's). Band 6's are of course favourable.
I hope this helps!