```ts
function rateCap(price: number, rate: number, most: number): number {
  if (price < 0 || rate < 0 || most <= 0) {
    throw new Error('Invalid input');
  }

  const increase = Math.floor((price * rate) / 100);
  const cappedIncrease = Math.min(increase, most);

  return price + cappedIncrease;
}
```