Let $\{Y_t\}_{t \in \mathbb{N}}$ be a random walk on $\mathbb{Z}$ defined as follows:
$\mathbb{P}(x,x+1) = \begin{cases} p & \text{ if } x \geq 1\\ 1-p & \text{ if } x \leq 0 \end{cases}$
$\mathbb{P}(x,x-1) = \begin{cases} 1-p & \text{ if } x \geq 1\\ p & \text{ if } x \leq 0 \end{cases}$
Where $\mathbb{P}(x,y)$ is given by $P(Y_{t+1}=y|Y_t=x)$
The problem proposed is to calculate $E[\tau]$ where $\tau = \inf\{t\geq0: Y_t \in \{-N, N\}\}$
I'm trying to use the martingales approach made to the original gambler's ruin discussed on page 244 of the book Markov Chains and Mixing Times of Levin, Peres, Wilmer. The authors propose that $$M_t =\bigg(\dfrac{q}{p}\bigg)^{Y_t} $$ is a martingale when the transition probabilities does not change, e.g $\mathbb{P}(x,x+1) = p$ and $\mathbb{P}(x,x-1) = (1-p)$ for all $x\in \mathbb{Z}$
I tried to verify that $M_t$ is not a martingale for my case, and I endeded up finding that is a martingale only when p = 1-p, which is not the idea of the problem. But I'm kind of lost now, because this was a key part of the solution, and I don't have a clue how to use another martingale. My first guess was to try to verify if the following process is a martingale: $$S_t = \Bigg(\dfrac{q}{p}\Bigg)^{Y_t} \mathbb{1}_{\{Y_{t}> 0\}} + \Bigg(\dfrac{p}{q}\Bigg)^{Y_t} \mathbb{1}_{\{Y_{t}\leq 0\}}$$
But I'm getting some trouble in the process and I'm thinking that my guess is not a thing. I'm new to the concept of martingales, so feel free to give a material or something that can help me on this specific case. I dind't manage to find questions about random walks on $\mathbb{Z}$ with changing probabilities in any place, so I'm profoundly lost, any help is welcome.
Here is my attempt, that I could not manage to conclude, to verify if $S_t$ is a martingale. I used $q=1-p$ to simplify. \begin{align*} \mathbb{E}\big[S_{t+1} | \mathbb{F}\big] &= \mathbb{E}\Bigg[ \Bigg(\dfrac{q}{p}\Bigg)^{Y_{t+1}} \mathbb{1}_{\{Y_{t+1}> 0\}} \bigg| \mathbb{F}\Bigg] + \mathbb{E}\Bigg[ \Bigg(\dfrac{p}{q}\Bigg)^{Y_{t+1}} \mathbb{1}_{\{Y_{t+1}\leq 0\}} \bigg| \mathbb{F}\Bigg]\\ &=\Bigg(\dfrac{q}{p}\Bigg)^{Y_t}\mathbb{E}\Bigg[ \Bigg(\dfrac{q}{p}\Bigg)^{Y_{t+1} -Y_t} \mathbb{1}_{\{Y_{t+1}> 0\}} \bigg| \mathbb{F}\Bigg] + \Bigg(\dfrac{p}{q}\Bigg)^{Y_{t}}\mathbb{E}\Bigg[ \Bigg(\dfrac{p}{q}\Bigg)^{Y_{t+1} -Y_t} \mathbb{1}_{\{Y_{t+1}\leq 0\}} \bigg| \mathbb{F}\Bigg]\\ &=\Bigg(\dfrac{q}{p}\Bigg)^{Y_t}\big(p \mathbb{1}_{\{Y_{t} = 1\}} + q \mathbb{1}_{\{Y_{t} = 0\}} + \mathbb{1}_{\{Y_{t} > 1\}}\big)\mathbb{E}\Bigg[\Bigg(\dfrac{q}{p}\Bigg)^{Y_{t+1} -Y_t} \bigg| \mathbb{F}\Bigg] + \\&+\Bigg(\dfrac{p}{q}\Bigg)^{Y_t}\big(p \mathbb{1}_{\{Y_{t} = 0\}} + q \mathbb{1}_{\{Y_{t} = 1\}} + \mathbb{1}_{\{Y_{t} \leq -1\}}\big)\mathbb{E}\Bigg[\Bigg(\dfrac{p}{q}\Bigg)^{Y_{t+1} -Y_t} \bigg| \mathbb{F}\Bigg]\\ \end{align*}
Here I tried to use the same idea that was used on the original gambler's ruin problem.
\begin{align} \mathbb{E}\Bigg[\Bigg(\dfrac{p}{q}\Bigg)^{Y_{t+1} -Y_t} \bigg| \mathbb{F}\Bigg] &=(p\mathbb{1}_{\{Y_{t+1} > 0} + q\mathbb{1}_{\{Y_{t+1} \leq 0\}})\dfrac{q}{p} + (p\mathbb{1}_{\{Y_{t+1} \leq 0} + q\mathbb{1}_{\{Y_{t+1} > 0\}})\dfrac{p}{q} \end{align}
\begin{align} \mathbb{E}\big[S_{t+1} | \mathbb{F}\big] &=\Bigg(\dfrac{q}{p}\Bigg)^{Y_t}\big(p \mathbb{1}_{\{Y_{t} = 1\}} + q \mathbb{1}_{\{Y_{t} = 0\}} + \mathbb{1}_{\{Y_{t} > 1\}}\big)\Bigg(\mathbb{1}_{\{Y_{t+1} > 0\}} + \mathbb{1}_{\{Y_{t+1} \leq 0\}} \Big(\dfrac{p^2}{q} + \dfrac{q^2}{p}\Big)\Bigg)+ \\&+\Bigg(\dfrac{p}{q}\Bigg)^{Y_t}\big(p \mathbb{1}_{\{Y_{t} = 0\}} + q \mathbb{1}_{\{Y_{t} = 1\}} + \mathbb{1}_{\{Y_{t} \leq -1\}}\big)\Bigg(\mathbb{1}_{\{Y_{t+1} \leq 0\}} + \mathbb{1}_{\{Y_{t+1} > 0\}} \Big(\dfrac{p^2}{q} + \dfrac{q^2}{p}\Big)\Bigg)\\ &= \Bigg(q\bigg(\mathbb{1}_{\{Y_{t} =1\}} + \mathbb{1}_{\{Y_{t} = 0\}}\bigg) + \Big(\dfrac{q}{p}\Big)^{Y_t}\mathbb{1}_{\{Y_{t} > 1\}}\Bigg)\Bigg(\mathbb{1}_{\{Y_{t+1} > 0\}} + \mathbb{1}_{\{Y_{t+1} \leq 0\}} \Big(\dfrac{p^2}{q} + \dfrac{q^2}{p}\Big)\Bigg)+ \\&+\Bigg(p\bigg(\mathbb{1}_{\{Y_{t} =1\}} + \mathbb{1}_{\{Y_{t} = 0\}}\bigg) + \Big(\dfrac{p}{q}\Big)^{Y_t}\mathbb{1}_{\{Y_{t} \leq 1\}}\Bigg)\Bigg(\mathbb{1}_{\{Y_{t+1} \leq 0\}} + \mathbb{1}_{\{Y_{t+1} > 0\}} \Big(\dfrac{p^2}{q} + \dfrac{q^2}{p}\Big)\Bigg)\\ &= \bigg(\mathbb{1}_{\{Y_{t} =1\}} + \mathbb{1}_{\{Y_{t} = 0\}}\bigg) \Bigg(q\mathbb{1}_{\{Y_{t+1} > 0\}} + q\mathbb{1}_{\{Y_{t+1} \leq 0\}} \Big(\dfrac{p^2}{q} + \dfrac{q^2}{p}\Big) + p\mathbb{1}_{\{Y_{t+1} \leq 0\}} + p\mathbb{1}_{\{Y_{t+1} > 0\}} \Big(\dfrac{p^2}{q} + \dfrac{q^2}{p}\Big)\Bigg) \\&+ \Big(\dfrac{q}{p}\Big)^{Y_t}\mathbb{1}_{\{Y_{t} > 1\}}\mathbb{1}_{\{Y_{t+1} > 0\}} + \Big(\dfrac{p}{q}\Big)^{Y_t}\mathbb{1}_{\{Y_{t} \leq 1\}}\mathbb{1}_{\{Y_{t+1} \leq 0\}} \end{align}