The problem I'm addressing is to find the probability mass function of the sum of $n$ i.i.d. Random Variables, each of them having a categorical distribution with outcomes $-1$, $0$ and $1$ with probabilities $p_1$, $p_2$ and $p_3$ respectively.
This can be seen as a generalization of a binomial distribution (which can be defined as the distribution of the sum of $n$ i.i.d. Bernoulli Random Variables) when the outcome $-1$ is also allowed (and therefore the sum could decrease).
I encountered this problem in the context of random walks, and I was able to find the solution inspired by this answer and also by the answers to this question I posted earlier, so I wanted to share it as an answer to my own question. I also would really appreciate if some else is able to come up with a better solution or a better explanation or mathematical formulation.