Hi @RickW - you're missing a few brackets and braces:
if (msg.payload > 2000) {
msg.payload = msg.payload - 65535;
}
return msg;
Here's a good guide on the basics of conditional statements in JavaScript - https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/conditionals
The other pages around that one cover other useful topics.