def convert(value, row):
    """Step 1c: If achg=250 and achgsvr=1, recode achg=230
    Step 1d: If achg=250 and achgsvr=2, recode achg=230
    Step 1e: If achg=135 and achgsvr=1, recode achg=120
    Step 1f: If achg=135 and achgsvr=2, recode achg=120 and ancic=1313"""
    
    severity = row['achgsvr']
    
    if severity == 1:
        if value == 250:
            return 230
        elif value == 135:
            return 120
    
    elif severity == 2:
        if value == 250:
            return 240
        elif value == 135:
            row['ancic'] = 1313
            return 130

    return value