I don’t know how you guys do with a series compared to single books, as this may be memory of the plot being tied to all the books, but I will try to order what I can remember as I go. If I were to guess I’d say there’s between 3 and 6 books.
Firstly I believe the story starts in a village in Japan. I don’t remember if the main character is foreign or Japanese. But the village is attacked by either ninjas or samurai from the emperor/shogun. The main character flees and at some point is sent on a journey to find certain treasures (maybe pertaining to the elements? Fire, sky, water, and earth). I only say this because at some point he is tasked to swim underwater for some item (I think jewelry or a pearl?) and while seeking the item underwater is tested or attacked by either a mermaid or a dragon. I know during his adventure he’s being chased by some guy who I think dies on his horse?
As the story at this point diverges from the main characters’ journey to this bad guy in hell who is trapped there wishing for revenge. Eventually the guy in hell gets free by finding the strength in a maggot he manages to eat. He escapes hell and rejoins the world as an undead and eventually starts killing other people in his quest for revenge and grows an undead army. (I’m assuming this part is in the final book) The main character hears of this and is tasked with climbing a mountain to obtain a powerful sword guarded by a dragon. The dragon tests him and after some sort of battle and fire breathing let’s him have the sword in which the character wraps up the story by killing the undead guy again.
If you have any questions please let me know! It’s been bugging me that I can’t remember. During your search you may come across a series called Young Samurai which is 8 books. I’ve read that series recently so I know it is not that one at least.