It is not recommended to connected CMOD value on the SWD pins. This will affect the programmimg.
If you are using SWD (and not JTAG) protocol for programming, then the pins P1 and P1 are free. There is XRES pin on the chip which is connected to JTAG 10-pin connector, hence P1 is also free. Therefore, you can use any of the pins P1, P1 and P1 to connect CMOD capacitor.