How can I correct the 'Save (amount)' feature for different variant prices on Dawn theme?

coz in coding calculated save amount= compare_at_price_max-product.price insted of saveamount=target.compare_at_price_max-target.product.price(on variant change price)