Speaking from personal experience, retakes, while likely to harm your applications are not a deal breaker. If you had some extenuating circumstances especially. AS UMS are not the best predictor for many subjects including maths tripos where GCSEs are better, but I guess the thing with maths is no pre admissions exam. Wish courses with pre admissions exams you could especially show higher performance than your as would suggest.
I myself had some extenuating circumstances, though I feel like not too strong, and ended up getting grade below standard requirements in each one of my 3 subjects. Yet I received an offer this year conditional on my a level retake grades.