def calculate_tax_for_bracket(
    income: float, tax_bracket: int, next_bracket: int, tax_rate: float
):
    """Use this function to calculate the tax amount for a specific bracket.

    This function is used for calculating the tax amount for a specific tax bracket
    given the income.

    :param income: the income to tax.
    :param tax_bracket: the tax bracket being checked.
    :param next_bracket: the next bracket to only tax the specific amount.
    :param tax_rate: the tax rate for the given bracket.
    :return: the taxed amount and the new income amount to pass to following function.
    """
    if income >= tax_bracket:
        taxable_income = income - next_bracket
        taxed_amount = taxable_income * tax_rate
        return taxed_amount, next_bracket
    else:
        return 0, income