>>761
bool add_ubound(float& x, float xmax, float add)
{
  assert(x > 0);
  assert(add > 0);
  asert(xmax > 0);
  assert(x <= xmax);

  x += add;
  if (x > xmax) {
    x = xmax;
    return true;
  }
  return false;
}

>>763
if (add_ubound(hp, MAX_HP, 10)) {
  playSound();
}

ベタだけど、こんな感じで処理してる。あと >>769 みたく上限加減とか
ループとか扱う関数をいくつか用意。