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 down-and-out barrier call option, assuming that $S_t/P_t$ is log-normally distributed under the measure $Q_p$.
Note that, under $Q_p$, the process $\{S_t/P_t \mid t \geq 0\}$ is a martingale, that is, we can treat $S_t/P_t$ as an asset process with zero interest and zero dividend. Using the down-and-out barrier call option formula in John Hull, we obtain that
\begin{align*}
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) = \frac{S_0}{P_0}-1.
\end{align*}
That is, the option price is $S_0-P_0$.