I assume that counters are only counted if they are in the correct (not built-in) cell. This is great because inline cells are for formatting purposes only and not for document structure.
Increasing a counter works great if you move it to an external cell. Code change above:
CellPrint[Cell["Setting the counter to 0", "Text", CounterAssignments -> {{"MyCounter", 0}}]] (* Prints a cell containing: Setting the counter to 0 *) CellPrint[Cell[ TextData[RowBox[{"MyCounter ", CounterBox["MyCounter"], Cell[TextData[RowBox[{"[InlineCell]"}]], "Text"]}]], "Text", CounterIncrements -> "MyCounter"]] (* Prints a cell containing: MyCounter 1[InlineCell] *)
Is this something like your previous Definition style ? If so, why donβt you have a built-in cell as a simple (untrue) cell that inherits its style from an external cell. Then simply enter the counter in the Definition style, i.e. In the stylesheet? As I said above, a cell other than the built-in one should be the one that is written (like "definition", "chapter", "section", etc.), since this determines the structure of the document.
Edit in response to comments:
Here is a palette that will create new chapter cells and new definition cells. The latter with a built-in, non-editable counter. Please note: most of the style should be moved to the stylesheet.
CreatePalette[With[{nb = InputNotebook[]}, { Button["New Chapter", SelectionMove[nb, After, Cell]; NotebookWrite[nb, Cell["New Chapter", "Chapter" (* Styling is in stylesheet*)]]], Button["New Definition", SelectionMove[nb, After, Cell]; NotebookWrite[nb, Cell[TextData[RowBox[ {Cell[TextData[ StyleBox[#, FontWeight -> "Bold"] & /@ { "Definition ", CounterBox["Chapter"], ".", CounterBox["Definition"], ": "}], Editable -> False, Selectable -> False, Deletable -> False], "New definition"}]], "Definition", CounterIncrements -> "Definition", CellFrame -> {{1, 1}, {0, 2}}, CellMargins -> {{30, 24}, {6, 6}}, CellFrameColor -> RGBColor[0, 0, 1], Background -> RGBColor[0, 1, 1]]] ]}], WindowTitle -> "Document writing palette"];