Hp/Sp bar help

Wonderin if nayone knows how to make a sp/hp bar gow down a certin amount when attacked the number part is no problem i can do that its the shrinking of the actual bar im a little lost on. any ideas?