You need to break the loop once the desired value is matched, so put "break;" keyword in your if block.
if(TypeWord == "Overall Discount (%)"){this.rawValue = xfa.resolveNode("xfa.record.FormPurchaseOrder.PriceAndTax.PriceComponent["+ i +"].CalculatedAmount").value;
break;}