Basically solved! Code is as follows. This requires dataview and numerals add-ons for obsidian. I think there is some weird behaviour with the floor function that should be at the start of the g(x) function but i would guess that it is because it isnt a function that numerals supports perhaps? I haven't looked at this yet.
--- numerals: all
strsco: 10
consco: 16
dexsco: 16
intsco: 10
wissco: 12
chasco: 8
---
```math
# define ability modifier calculation function
g(x) = (x - 10)/2
# ability scores are specified in the properties
# calculate the modifiers using the ability modifier function g(x)
@[strmod::0] = g(strsco)
@[conmod::3] = g(consco)
@[dexmod::3] = g(dexsco)
@[intmod::0] = g(intsco)
@[wismod::1] = g(wissco)
@[chamod::-1] = g(chasco)
# calculate AC
@[ac::16] = 10 + conmod + dexmod
```
AC is `=this.ac`
References: