CRM Online Calculations

I have an aold CRM system we are upgrading to CRM Online.
There are a number of calculations carried out by Javascript in the system which we are hoping to replace with Business Rules or Calculated fields. We are finding this difficult to do due to the complexity of the Javascript.
I have copied in a snippet of the Javascript, would anyone know if it’s possible to do this another way other than through Javascript?

If (estimate >= appsEst) {
if (type == “A” && estimate != null && appsEst != null && income != null) {
if (income <= 37500) {
grantAmt = appsEstimate * 1.00;
grantField.setValue(grantAmt > 40000 ? 40000 : grantAmt);
Per.setValue(“1.00”);
}
else if (income <= 43750) {
grantAmt = appsEstimate * 0.85;
grantField.setValue(grantAmt > 34000 ? 34000 : grantAmt);
Per.setValue(“0.85”);
}
else if (income <= 50000) {
grantAmt = appsEstimate * 0.75;
grantField.setValue(grantAmt > 30000 ? 30000 : grantAmt);
Per.setValue(“0.75”);
}
}