We know that $$\cot (A+B) = \frac {\cot A \cot B -1 }{\cot A + \cot B} $$
As $A+B =225^\circ $, simplifying the above equation gives us $$\cot A + \cot B +1 =\cot A \cot B \tag {1} $$
Now from the original expression, we get, $$P = \frac {\cot A \cot B}{(1+\cot A)(1+\cot B)} = \frac {\cot A \cot B}{1+\cot A +\cot B +\cot A \cot B} = \frac {\cot A\cot B}{2\cot A \cot B} = \frac {1}{2} $$
If you want to continue with your method, we have, $$P = \frac {\cot A \cot B}{(1+\cot A)(1+\cot B)} = \frac {\cos A \cos B}{\sin (A+B) + \cos (A-B)}$$ Now substituting $A=225^\circ -B $, we get, $$P = \frac {\cos 225^\circ \cos^2 B + \sin 225^\circ \sin B \cos B}{\sin 225^\circ + \cos 225^\circ \cos 2B + \sin 225^\circ \sin 2B } $$ As $\cos 225^\circ = \sin 225^\circ $, we have, $$P =\frac {\cos B (\cos B + \sin B)}{1 + \cos 2B + \sin 2B} $$ and using $\cos 2B +1 =2\cos^2 B $ and $\sin 2B =2\sin B \cos B $ gives us the result as $$\boxed{P = \frac {1}{2}} $$ the same as before.
Hope it helps.