The option payoff at maturity $T$ is defined by
\begin{align*}
(S_T-P_T)1_{\left(\inf_{0 \le t <T}\frac{S_t}{P_t}\right) > 1}.
\end{align*}
Let $Q$ be the risk-neutral probability measure and $E$ be the corresponding expectation operator. Let $Q_p$ be a probability measure defined by
\begin{align*}
\frac{dQ_p}{dQ}\big|_t = \frac{P_t}{e^{rt} P_0}.
\end{align*}
Moreover, let $E_p$ be the corresponding expectation operator.
Then the option value can be computed by
\begin{align*}
e^{-rT}E\left((S_T-P_T)1_{\left(\inf_{0 \le t <T}\frac{S_t}{P_t}\right) > 1} \right) &= e^{-rT}E_p\left(\left(\frac{dQ_p}{dQ}\big|_T\right)^{-1}(S_T-P_T)1_{\left(\inf_{0 \le t <T}\frac{S_t}{P_t}\right) > 1} \right)\\
&=P_0 E_p\left(\left(\frac{S_T}{P_T}-1\right)1_{\left(\inf_{0 \le t <T}\frac{S_t}{P_t}\right) > 1} \right),
\end{align*}
which can be treated as a usual barrier option, assuming that $S_t/P_t$ is log-normally distributed.