The first error is not from my display script, that script doesn't use any method named xstat_change. It doesn't even do anything with items, so no idea what you did, but your best bet is to delete the script, get the original, and edit the settings again.
It can happen from getting the xstat value itself, but that error comes from the original xstat script than, and not from my script. Either a setting error in that script, or you found a new bug somehow.
The second error also happens because you edited something in that script.
You must be extra careful when you edit scripts, even when you edit the settings. One missed comma, bracket, etc or even an extra of those, and the script will crash on startup. Every single letter is important.
Try to do the same with this script too, get the original and edit it again, but this time, pay attention to what you edit and how.
And in case you copied the scripts wrong from the start (didn't get the whole script, for example), make sure that you copy the whole thing, otherwise you will surely get errors, much like that last one you have shown.