Jan Ansgary Czapski — military personnel, Polish–Lithuanian Commonwealth