Please read this page for posting code nicely on the forums: Using code tags properly
You can edit your post & keep it in mind for future postings.
Change the DealDamage method to be public.
Then create a reference for HealthBar script on whichever script your first one was.
Now, when you run into pick up 1, do something like:
myHealthBar.DealDamage(5); // where 'myHealthBar' is the variable for your health bar script that you created and assign by drag & drop in the inspector***