I don't understand your question..
What are you trying to achieve?
"How do objects communicate?
How do I let the other 3 layers know that they are supposed to be destroyed?
"set layer.Hp to dirt.Hp""
You want to destroy something, obviously, but the whole layer?
Why does the layer have hp (Layers don't have variables, do they?)?
Why do other layers get the same hp?
Couldn't you use a condition to determine what the hp should be if dirt = 50 if granite = 100, etcetera?