Calculating Water Consumption using Droplet (JS issue)

Just confirming changing that statement picking up the state solved the issue.
Thanks for your help. Working through this taught me a lot…