Let’s say I have a friend. When I go out with this friend, I tend to overdo the drinking more often than not. I go to confession and confess the excessive drinking, but I think “Next time I go out with Jim, I just won’t drink as much-I need to learn to control myself, not stop seeing Jim altogether.”. I tell the priest that when I go out with Jim, this can be a near occasion of sin for me, but that I am going to limit my drinking next time I go out with Jim. He absolves me.
Is this valid?
I cannot answer whether or not it is valid, since I do not know the state of your soul, contrition or your commitment to never sinning again. Not enough detail, and I don’t think you should give any more. This is between you, confessor and God.
Speak to a Priest about it.
However, I can speak generally, if it will help, and this is only my opinion based on my understanding!
If you go into confession with full knowledge that you will sin again (i.e. “oh, it will probably happen again, you know me”) then you are not truly sorry and this invalidates your confession (because a valid confession requires being truly sorry, which means you never want to sin ever again). If you go into confession with no firm purpose not to sin again, this also invalidates your confession and is an abuse of the sacrament, it also tempts God. You must go into confession repentant - that is, you must have a firm and strong will never to sin again. Otherwise, again, you are not truly sorry. You must not, in your mind, have a thought that in the future you probably will do x and y again which will make you sin. You have to really mean it when you say that you will never sin again. If by saying “I will drink less” you honestly believe it at the time of saying it, then it seems your confession is valid, though I am not sure how sorry one truly is by putting yourself in the near occasion of sin despite being truly sorry. Think of it like this, if I confess to my wife I had an affair with Sarah who is gorgeous and brings out the beast in me… would it be honest, or good, of me to then tell my wife that despite my sorrow at the affair I will still hang around with Sarah just not have the affair part.
As for near occasions of sin, they can be sins in themselves if serious and/or frequent enough. If you know full well that hanging out with someone usually means you will commit mortal sin, you sin by hanging out with them and not putting a stop to that friendship. Jesus commands us to be perfect as our Father is perfect - and we must be saints to enter into Heaven. This means we must detach from all sinful desires and all things that lead us into sin. If a near occasion of sin always leads you into sin, you sin by being in that near occasion of sin. To make it easier to think about, let us use a silly example. If everytime I stick my finger in my ear I curse God it follows that sticking my finger in my ear is a near occasion of sin. If I know this and yet continue to stick my finger in my ear, I am sinning by sticking my finger in my ear even without cursing God. Why? Because I tempt God ; because I tempt myself ; and because I have no desire to run as fast as I can away from anything that leads me into sin.
Notice in the Act of Contrition the lines “…and to avoid the near occasions of sin. Amen” or something similar. They are there for a reason.
Whatever the case may be, God is smiling upon you and you are doing the right thing in going to confession!