Shared health bar with dog

Hi! Im trying to make it so that I share a health bar with a dog... if he gets hurt, i do, if I get hurt, he does... same if I die or if he dies... kinda aiming to make this a hardcore, thought itd be cool yk... I already tried starting but there arent any results in the game... please dont make fun of me lol but I asked chatgpt and that thing is bad lol but ig it might be steering me in the rightish direction, it just doesnt know how to code yk..

Continue to help post