def get_holding_data(holdings, stimulus_data, total_duration, default_holding):
    """Extract holding data from StepProtocol json dict and add amplitude to a holding list.

    Args:
        holdings (list): list of holding amplitudes (nA) to be updated
        stimulus_data (dict): stimulus dict from protocol json file containing holding data
        total_duration (float): total duration of the step (ms)
        default_holding (float): default value for the custom holding entry

    Returns:
        a tuple containing

        - float: delay of the holding stimulus (ms)
        - float: duration of the holding stimulus (ms)
    """
    if "holding" in stimulus_data:
        holding = stimulus_data["holding"]

        # amp can be None in e.g. Rin recipe protocol
        if holding["amp"] is not None and holding["amp"] != default_holding:
            holdings.append(holding["amp"])

        hold_step_delay = holding["delay"]
        hold_step_duration = holding["duration"]
    else:
        hold_step_delay = 0.0
        hold_step_duration = total_duration

    return hold_step_delay, hold_step_duration