Gojs link port snap event

if you want to change the node background when the other node is snap on the port.
How do I do that?

That is what this property is for: https://gojs.net/latest/api/symbols/LinkingBaseTool.html#portTargeted

But I see that you have already modified the standard LinkingTool behavior.