How do I read or modify the variables that come with GameObject in GDscript?

I have a child node “Node2D” in my “GameObject”,

I want to add a GDScript to “Node2D”,

When the variable “hp” equals “max_hp” of the “GameObject”,

the visibility of “Node2D” = False;

When the variable “hp” of the “GameObject” is less than “max_hp”,

the visibility of “Node2D” = True;

How should I write the code?

Reference Deep Dive into AGMaker: Script Snippet - Printing Variables and Switches with Specific Names - ACTION GAME MAKER / General - RPG MAKER GUILD - https://guild.rpgmakerofficial.com/