Looks like the problem is that tGen isn't a derived field, meaning it wasn't set up to be messed with by user scripts. I think you can probably get around this with a trustme command (although we discourage users from using them, so don't make a habit of this).
~ If we're not enabled, get out now
doneif (field[pIsOn].value = 0)
trustme
~ Add extra attribute points for nonstandard point-buy.
herofield[tGen].value += field[pAdjust].value
|