def GetStrucPrevOff(sid, offset):
    s = idaapi.get_struc(sid)
    if not s:
        return -1

    return idaapi.get_struc_prev_offset(s, offset)
Get previous offset in a structure
dataset/ETHPy150Open EiNSTeiN-/idapython/python/idc.py/GetStrucPrevOff