Can I increment a (possibly null) context variable in a change node?

That's the answer!
So using that I have

[{"id":"112a69ed01730f17","type":"inject","z":"3378d78bb37c052e","name":"go","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":90,"y":60,"wires":[["d51cde875f4b5a0a"]]},{"id":"b23439ad43e95d6e","type":"file in","z":"3378d78bb37c052e","name":"flows.json","filename":".node-red/flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":480,"y":60,"wires":[["69782fbbccdc6b91"]]},{"id":"69782fbbccdc6b91","type":"json","z":"3378d78bb37c052e","name":"","property":"payload","action":"","pretty":false,"x":610,"y":60,"wires":[["cb63f29ecd2aaa90"]]},{"id":"cb63f29ecd2aaa90","type":"split","z":"3378d78bb37c052e","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":730,"y":60,"wires":[["ba5835d2d3c68141"]]},{"id":"d51cde875f4b5a0a","type":"change","z":"3378d78bb37c052e","name":"delete flow.messagecounts","rules":[{"t":"set","p":"messagecounts","pt":"flow","to":"{\"ui_spacer\": 2}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":60,"wires":[["b23439ad43e95d6e"]]},{"id":"ba5835d2d3c68141","type":"change","z":"3378d78bb37c052e","name":"Count each node type","rules":[{"t":"set","p":"increment","pt":"msg","to":"messagecounts[msg.payload.type]","tot":"flow"},{"t":"set","p":"increment","pt":"msg","to":"increment ? increment + 1 : 1","tot":"jsonata"},{"t":"set","p":"messagecounts[msg.payload.type]","pt":"flow","to":"increment","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":140,"y":120,"wires":[["9893a5a9708d4e00"]]},{"id":"9893a5a9708d4e00","type":"switch","z":"3378d78bb37c052e","name":"Last msg part?","property":"parts.count","propertyType":"msg","rules":[{"t":"eq","v":"parts.index + 1","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":1,"x":340,"y":120,"wires":[["6c23c7047b383eb2"]]},{"id":"b121e56aabb8829a","type":"debug","z":"3378d78bb37c052e","name":"debug 482","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":750,"y":120,"wires":[]},{"id":"6c23c7047b383eb2","type":"change","z":"3378d78bb37c052e","name":"Final counts to payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"messagecounts","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":120,"wires":[["b121e56aabb8829a"]]}]

None of the other approaches worked for me, sorry guys :thinking:
I appreciate the suggestions though.