Pokemon R/B/Y/G/S/C - Influence of HP on animations and battle messages
The remaining HP of a Pokemon affects the party menu animations and battle messages in several ways. This video shows the exact details.
Related code (R/B/Y):
https://github.com/pret/pokered/blob/2b2c6fe/engine/mon_party_sprites.asm#L84-89
https://github.com/pret/pokered/blob/7e12ca56/engine/battle/common_text.asm#L97-138
https://github.com/pret/pokered/blob/7e12ca56/engine/battle/common_text.asm#L171-220
Related code (G/S/C):
https://github.com/pret/pokecrystal/blob/7aef5984/engine/mon_icons.asm#L188-218
https://github.com/pret/pokecrystal/blob/7aef59841/battle/core.asm#L8036-8084
https://github.com/pret/pokecrystal/blob/7aef59841/battle/core.asm#L8122-8172
For reference of the HP bar color:
The HP bar is 48 pixels long in both generations. The amount of pixels left in the HP bar approximately represents the current (HP / max HP) ratio of the Pokemon. In Gen 1, the HP bar turns yellow when it has 26 or less pixels, while in Gen 2, it will turn yellow at 23 pixels or less. In both generations the HP bar turns red at 9 or less pixels.