That is the correct function. The arrow in a partial equals should always be on the left, and your whitespace is a bit off, which could possibly be the issue:
if ("NPC 2"->GetHealth <= 1)
Even better, remove the whitespace from the ID. You can test by setting a variable to the health value, then showing a messagebox with that.
Note that npc 2 should be loaded and active for this to work, or marked as references persist. This will also only use the first instance of NPC 2 that exists in the world.