You could write your own PSO tool. But that would be your choice. And there is no assurance this will work better. And structuring exactly the profile of how the decrease works might be an interesting and difficult problem since it would need to work on any general problem.
In fact, it might even be the WORST way to write such a solver. Why? Because it is when you get stuck in a local optimum that you want a LARGE swarm size, to give you the best chance of tunneling out of the local hole the solver is stuck inside.
Another problem with decreasing the swarm size near the end is this is where you are looking for tiny incremental changes to improve the convergence. Remember that near a minimum, any function that is well behaved, thus sufficiently differentiable, the solution will be at a relatively flat spot. As such, keeping the swarm size as large as possible will still help convergence rates. There are even some fractal arguments that argue for a uniform swarm size.
Paradoxically, there are some cases where what seems to be a logical heuristic algorithmic choice is actually the worst thing you can do. I know of at least one case where this is true in the design of optimization algorithms.
But do as you wish. You COULD write your own solver. Or, you could just use the existing solver, employing the largest large swarm size you can afford all the way down, and get a large cup of coffee while you wait. Personally, I dislike coffee, because it tastes bad and just keeps me awake.