```python
def tier_cost(units: int, allowance: int, first_rate: int, later_rate: int) -> int:
    """
    Calculate the cost of a number of units charged at a first rate up to an
    included allowance and at a second rate for everything beyond it.
    
    Args:
        units: The number of units to charge.
        allowance: The number of units covered by the first rate.
        first_rate: The cost per unit for the first rate.
        later_rate: The cost per unit for the second rate.
    
    Returns:
        The total cost in whole pence.
    
    Raises:
        ValueError: If units is negative.
    """
    if units < 0:
        raise ValueError("Number of units must be non-negative")
    
    if allowance < 0:
        allowance = 0
    
    if units <= allowance:
        return units * first_rate
    else:
        return allowance * first_rate + (units - allowance) * later_rate
```