It's a simple formula. (X-10)/2 rounded down to the nearest whole number.
This is what I have so far:
var a = this.getField("str")
event.value = (a.value -10)/2
But that just does the math part, and not the rounding down. I know math.floor is used, but not how. Thanks to anyone who can help!