We report Resonant inelastic x-ray scattering measurements (RIXS) in YbCu$_2$Si$_2$ at the Yb L$_{3}$ edge under high pressure (up to 22 GPa) and at low temperatures (down to 7 K) with emphasis on the vicinity of the transition to a magnetic ordered state. We find a continuous valence change towards the trivalent state with increasing pressure but with a pronounced change of slope close to the critical pressure. Even at 22 GPa the Yb$^{+3}$ state is not fully achieved. The pressure where this feature is observed decreases as the temperature is reduced to 9 GPa at 7K, a value close to the critical pressure (itshape{p ormalfont{$_c$}} ormalfont $approx$ 7.5 GPa) where magnetic order occurs. The decrease in the valence with decreasing temperature previously reported at ambient pressure is confirmed and is found to be enhanced at higher pressures. We also compare the f electron occupancy between YbCu$_2$Si$_2$ and its Ce-counterpart, CeCu$_2$Si$_2$.